Commit 17c82f9cd925ef97d65746909e12b1a1acc291c0

Authored by Antonio Terceiro
1 parent e571c718

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 10 File.exist?(f)
11 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 22 # explicitly changed tests
14 23 tests = changed_files.select { |f| f =~ /test\/.*_test\.rb$/ }
15 24 features = changed_files.select { |f| f =~ /\.feature$/ }
... ... @@ -27,6 +36,13 @@ namespace :ci do
27 36 sh 'testrb', '-Itest', *tests unless tests.empty?
28 37 sh 'cucumber', *features unless features.empty?
29 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 46 end
31 47  
32 48 end
... ...