Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'qa/tasks/knapsack.rake')
-rw-r--r--qa/tasks/knapsack.rake20
1 files changed, 10 insertions, 10 deletions
diff --git a/qa/tasks/knapsack.rake b/qa/tasks/knapsack.rake
index c1225964aef..c502d1cbb4a 100644
--- a/qa/tasks/knapsack.rake
+++ b/qa/tasks/knapsack.rake
@@ -18,20 +18,20 @@ namespace :knapsack do
desc "Download latest knapsack reports for parallel jobs"
task :download, [:stage_name] do |_, args|
test_stage_name = args[:stage_name]
+ knapsack_reports = ENV["QA_KNAPSACK_REPORTS"]&.split(",")
+ ci_token = ENV["QA_GITLAB_CI_TOKEN"]
- # QA_KNAPSACK_REPORTS remains for changes to be backwards compatible
- # TODO: remove and only use automated detection once changes are merged
- unless ENV["QA_KNAPSACK_REPORTS"] || test_stage_name
- QA::Runtime::Logger.warn("Missing QA_KNAPSACK_REPORTS environment variable or test stage name for autodetection")
- next
- end
+ reports = if knapsack_reports
+ knapsack_reports
+ else
+ unless ci_token
+ QA::Runtime::Logger.error("Missing QA_GITLAB_CI_TOKEN for automatically detecting parallel jobs")
+ next
+ end
- reports = if test_stage_name
QA::Support::ParallelPipelineJobs
- .fetch(stage_name: test_stage_name, access_token: ENV["QA_GITLAB_CI_TOKEN"])
+ .fetch(stage_name: test_stage_name, access_token: ci_token)
.map { |job| job.tr(":", "-") }
- else
- ENV["QA_KNAPSACK_REPORTS"].split(",")
end
reports.each do |report_name|