Spawn a new rake process to run tests, so that LOAD_PLUGINS gets re-checked (#5001)

This commit is contained in:
David Taylor 2017-07-26 17:54:56 +01:00 committed by Sam
parent 68d09e8315
commit 2c6ed64ebe
1 changed files with 10 additions and 4 deletions

View File

@ -101,14 +101,20 @@ desc 'run plugin qunit tests'
task 'plugin:qunit', [:plugin, :timeout] do |t, args| task 'plugin:qunit', [:plugin, :timeout] do |t, args|
args.with_defaults(plugin: "*") args.with_defaults(plugin: "*")
ENV['LOAD_PLUGINS'] = '1' rake = `which rake`.strip
ENV['QUNIT_SKIP_CORE'] = '1'
cmd = 'LOAD_PLUGINS=1 '
cmd += 'QUNIT_SKIP_CORE=1 '
if args[:plugin] == "*" if args[:plugin] == "*"
puts "Running qunit tests for all plugins" puts "Running qunit tests for all plugins"
else else
puts "Running qunit tests for #{args[:plugin]}" puts "Running qunit tests for #{args[:plugin]}"
ENV['QUNIT_SINGLE_PLUGIN'] = args[:plugin] cmd += "QUNIT_SINGLE_PLUGIN='#{args[:plugin]}' "
end end
Rake::Task["qunit:test"].invoke(args[:timeout]) cmd += "#{rake} qunit:test"
cmd += "[#{args[:timeout]}" if args[:timeout]
sh cmd
end end