mirror of
https://github.com/discourse/discourse.git
synced 2025-05-28 22:27:49 +08:00
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:
@ -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]
|
||||
|
Reference in New Issue
Block a user