From 2c6ed64ebe81da2dcd4e103f4534e0ecd3ad5798 Mon Sep 17 00:00:00 2001 From: David Taylor Date: Wed, 26 Jul 2017 17:54:56 +0100 Subject: [PATCH] Spawn a new rake process to run tests, so that LOAD_PLUGINS gets re-checked (#5001) --- lib/tasks/plugin.rake | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/lib/tasks/plugin.rake b/lib/tasks/plugin.rake index 9666ed747c4..99f15cb517f 100644 --- a/lib/tasks/plugin.rake +++ b/lib/tasks/plugin.rake @@ -101,14 +101,20 @@ desc 'run plugin qunit tests' task 'plugin:qunit', [:plugin, :timeout] do |t, args| args.with_defaults(plugin: "*") - ENV['LOAD_PLUGINS'] = '1' - ENV['QUNIT_SKIP_CORE'] = '1' + rake = `which rake`.strip + + cmd = 'LOAD_PLUGINS=1 ' + cmd += 'QUNIT_SKIP_CORE=1 ' + if args[:plugin] == "*" puts "Running qunit tests for all plugins" else puts "Running qunit tests for #{args[:plugin]}" - ENV['QUNIT_SINGLE_PLUGIN'] = args[:plugin] + cmd += "QUNIT_SINGLE_PLUGIN='#{args[:plugin]}' " end - Rake::Task["qunit:test"].invoke(args[:timeout]) + cmd += "#{rake} qunit:test" + cmd += "[#{args[:timeout]}" if args[:timeout] + + sh cmd end