mirror of
https://github.com/discourse/discourse.git
synced 2025-05-28 22:17:45 +08:00
DEV: Add --profile and --fail-fast when running plugin specs, tweak parallel test balancing
This commit is contained in:
@ -86,10 +86,11 @@ end
|
||||
desc 'run plugin specs'
|
||||
task 'plugin:spec', :plugin do |t, args|
|
||||
args.with_defaults(plugin: "*")
|
||||
params = ENV['RSPEC_FAILFAST'] ? '--profile --fail-fast' : '--profile'
|
||||
ruby = `which ruby`.strip
|
||||
files = Dir.glob("./plugins/#{args[:plugin]}/spec/**/*_spec.rb")
|
||||
if files.length > 0
|
||||
sh "LOAD_PLUGINS=1 #{ruby} -S rspec #{files.join(' ')}"
|
||||
sh "LOAD_PLUGINS=1 #{ruby} -S rspec #{files.join(' ')} #{params}"
|
||||
else
|
||||
abort "No specs found."
|
||||
end
|
||||
|
Reference in New Issue
Block a user