34 lines
1,019 B
Ruby
34 lines
1,019 B
Ruby
# frozen_string_literal: true
|
|
|
|
# rubocop:disable Rails/RakeEnvironment
|
|
namespace :knapsack do
|
|
desc "Run tests with knapsack runner"
|
|
task :rspec, [:rspec_args] do |_, args|
|
|
rspec_args = args[:rspec_args]&.split(' ') || []
|
|
|
|
unless QA::Runtime::Env.knapsack?
|
|
QA::Runtime::Logger.info("This environment is not compatible with parallel knapsack execution!")
|
|
QA::Runtime::Logger.info("Falling back to standard execution")
|
|
|
|
exit RSpec::Core::Runner.run([*rspec_args, "qa/specs/features"])
|
|
end
|
|
|
|
exit QA::Specs::KnapsackRunner.run(rspec_args)
|
|
end
|
|
|
|
desc "Download latest knapsack report"
|
|
task :download do
|
|
QA::Support::KnapsackReport.download_report
|
|
end
|
|
|
|
desc "Merge and upload knapsack report"
|
|
task :upload, [:glob] do |_task, args|
|
|
QA::Support::KnapsackReport.upload_report(args[:glob])
|
|
end
|
|
|
|
desc "Report long running spec files"
|
|
task :notify_long_running_specs do
|
|
QA::Support::LongRunningSpecReporter.execute
|
|
end
|
|
end
|
|
# rubocop:enable Rails/RakeEnvironment
|