DEV: Simplify qunit target selection (#22591)

Previously we had three query parameters to control which tests would be run. The default was to run all core/plugin tests together, which would almost always lead to errors and does not match the way we run tests in CI.

This commit removes the three old parameters (skip_core, skip_plugins and single_plugin), and introduces a new 'target' parameter. This can have a value of 'core', 'plugins', 'all', or a specific plugin name. The default is 'core'. Attempting to use the old parameters will raise an error.
This commit is contained in:
David Taylor
2023-07-13 14:20:00 +01:00
committed by GitHub
parent dfe94ba118
commit 9c915345ea
5 changed files with 69 additions and 70 deletions

View File

@ -209,14 +209,17 @@ task "plugin:qunit", %i[plugin timeout] do |t, args|
rake = "#{Rails.root}/bin/rake"
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]}"
cmd += "QUNIT_SINGLE_PLUGIN='#{args[:plugin]}' "
end
target =
if args[:plugin] == "*"
puts "Running qunit tests for all plugins"
"plugins"
else
puts "Running qunit tests for #{args[:plugin]}"
args[:plugin]
end
cmd += "TARGET='#{target}' "
cmd += "#{rake} qunit:test"
cmd += "[#{args[:timeout]}]" if args[:timeout]