From 17c82f9cd925ef97d65746909e12b1a1acc291c0 Mon Sep 17 00:00:00 2001 From: Antonio Terceiro Date: Fri, 7 Nov 2014 16:00:26 -0200 Subject: [PATCH] ci:smoke: run plugin tests the right way --- lib/tasks/ci.rake | 16 ++++++++++++++++ 1 file changed, 16 insertions(+), 0 deletions(-) diff --git a/lib/tasks/ci.rake b/lib/tasks/ci.rake index b1d9dba..5385aa9 100644 --- a/lib/tasks/ci.rake +++ b/lib/tasks/ci.rake @@ -10,6 +10,15 @@ namespace :ci do File.exist?(f) end + changed_plugin_files = changed_files.select do |f| + f.split(File::SEPARATOR).first == 'plugins' + end + changed_plugins = changed_plugin_files.map do |f| + f.split(File::SEPARATOR)[1] + end.uniq + + changed_files -= changed_plugin_files + # explicitly changed tests tests = changed_files.select { |f| f =~ /test\/.*_test\.rb$/ } features = changed_files.select { |f| f =~ /\.feature$/ } @@ -27,6 +36,13 @@ namespace :ci do sh 'testrb', '-Itest', *tests unless tests.empty? sh 'cucumber', *features unless features.empty? sh 'cucumber', '-p', 'selenium', *features unless features.empty? + + changed_plugins.each do |plugin| + task = "test:noosfero_plugins:#{plugin}" + puts "Running #{task}" + Rake::Task[task].execute + end + end end -- libgit2 0.21.2