Commit 17c82f9cd925ef97d65746909e12b1a1acc291c0
1 parent
e571c718
Exists in
master
and in
29 other branches
ci:smoke: run plugin tests the right way
Showing
1 changed file
with
16 additions
and
0 deletions
Show diff stats
lib/tasks/ci.rake
@@ -10,6 +10,15 @@ namespace :ci do | @@ -10,6 +10,15 @@ namespace :ci do | ||
10 | File.exist?(f) | 10 | File.exist?(f) |
11 | end | 11 | end |
12 | 12 | ||
13 | + changed_plugin_files = changed_files.select do |f| | ||
14 | + f.split(File::SEPARATOR).first == 'plugins' | ||
15 | + end | ||
16 | + changed_plugins = changed_plugin_files.map do |f| | ||
17 | + f.split(File::SEPARATOR)[1] | ||
18 | + end.uniq | ||
19 | + | ||
20 | + changed_files -= changed_plugin_files | ||
21 | + | ||
13 | # explicitly changed tests | 22 | # explicitly changed tests |
14 | tests = changed_files.select { |f| f =~ /test\/.*_test\.rb$/ } | 23 | tests = changed_files.select { |f| f =~ /test\/.*_test\.rb$/ } |
15 | features = changed_files.select { |f| f =~ /\.feature$/ } | 24 | features = changed_files.select { |f| f =~ /\.feature$/ } |
@@ -27,6 +36,13 @@ namespace :ci do | @@ -27,6 +36,13 @@ namespace :ci do | ||
27 | sh 'testrb', '-Itest', *tests unless tests.empty? | 36 | sh 'testrb', '-Itest', *tests unless tests.empty? |
28 | sh 'cucumber', *features unless features.empty? | 37 | sh 'cucumber', *features unless features.empty? |
29 | sh 'cucumber', '-p', 'selenium', *features unless features.empty? | 38 | sh 'cucumber', '-p', 'selenium', *features unless features.empty? |
39 | + | ||
40 | + changed_plugins.each do |plugin| | ||
41 | + task = "test:noosfero_plugins:#{plugin}" | ||
42 | + puts "Running #{task}" | ||
43 | + Rake::Task[task].execute | ||
44 | + end | ||
45 | + | ||
30 | end | 46 | end |
31 | 47 | ||
32 | end | 48 | end |