A platform for community discussion. Free, open, simple.
DEV: Add --profile and --fail-fast when running plugin specs, tweak parallel test balancing
Penar Musaraja5b804fec499
diff --git a/lib/tasks/docker.rake b/lib/tasks/docker.rakeindex d4f09ff0479..95d81aaafe1 100644--- a/lib/tasks/docker.rake+++ b/lib/tasks/docker.rake@@ -139,7 +139,8 @@ task 'docker:test' dospec_partials = Dir["spec/**/*_spec.rb"].sort.in_groups(total, false)# quick and dirty load balancingif (spec_partials.count > 3)- spec_partials[0].concat(spec_partials[total - 1].shift(40))+ spec_partials[0].concat(spec_partials[total - 1].shift(30))+ spec_partials[1].concat(spec_partials[total - 2].shift(30))endparams << spec_partials[subset].join(' ')@@ -154,7 +155,7 @@ task 'docker:test' doif ENV["SINGLE_PLUGIN"]@good &&= run_or_fail("bundle exec rake plugin:spec['#{ENV["SINGLE_PLUGIN"]}']")else- @good &&= run_or_fail("bundle exec rake plugin:spec")+ @good &&= run_or_fail("RSPEC_FAILFAST=1 bundle exec rake plugin:spec")endendputs "travis_fold:end:ruby_tests" if ENV["TRAVIS"]diff --git a/lib/tasks/plugin.rake b/lib/tasks/plugin.rakeindex c77525038f5..afd36da4302 100644--- a/lib/tasks/plugin.rake+++ b/lib/tasks/plugin.rake@@ -86,10 +86,11 @@ enddesc '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`.stripfiles = 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}"elseabort "No specs found."end