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
path: root/qa/tasks
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-05-24 00:09:55 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-05-24 00:09:55 +0300
commit4e175ca905e0c6bdcf83f78fcffd1f5bc8767f82 (patch)
tree7285e810a23238b2eba789419554cd86c9d968f3 /qa/tasks
parent3ca896b640def57a58485def308748b2fccbd0bb (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'qa/tasks')
-rw-r--r--qa/tasks/ci.rake12
-rw-r--r--qa/tasks/knapsack.rake13
2 files changed, 25 insertions, 0 deletions
diff --git a/qa/tasks/ci.rake b/qa/tasks/ci.rake
index e5f4acb158b..3dfad6a82fd 100644
--- a/qa/tasks/ci.rake
+++ b/qa/tasks/ci.rake
@@ -30,6 +30,18 @@ namespace :ci do
# on run-all label of framework changes do not infer specific tests
tests = run_all_label_present || qa_changes.framework_changes? ? nil : qa_changes.qa_tests
+ # When QA_TESTS only contain folders and no specific specs, populate KNAPSACK_TEST_FILE_PATTERN
+ if tests && tests.split(' ').none? { |item| item.include?('_spec') }
+ test_paths = tests.split(' ').map { |item| "#{item}**/*" }
+
+ files_pattern = "{#{test_paths.join(',')}}"
+
+ logger.info(" Files pattern for tests: #{files_pattern}")
+ append_to_file(env_file, <<~TXT)
+ KNAPSACK_TEST_FILE_PATTERN='#{files_pattern}'
+ TXT
+ end
+
if run_all_label_present
logger.info(" merge request has pipeline:run-all-e2e label, full test suite will be executed")
append_to_file(env_file, "QA_RUN_ALL_E2E_LABEL=true\n")
diff --git a/qa/tasks/knapsack.rake b/qa/tasks/knapsack.rake
index 5e60703ced3..b8a8d6e1145 100644
--- a/qa/tasks/knapsack.rake
+++ b/qa/tasks/knapsack.rake
@@ -42,6 +42,19 @@ namespace :knapsack do
end
end
+ desc "Create knapsack reports from existing reports for selective jobs"
+ task :create_reports_for_selective do
+ reports = Dir.glob("knapsack/*").map { |file| file.match(%r{.*/(.*)?\.json})[1] }
+
+ reports.each do |report_name|
+ unless report_name.include?('-selective-parallel')
+ QA::Support::KnapsackReport.new(report_name).create_for_selective(ENV['QA_TESTS'])
+ end
+ rescue StandardError => e
+ QA::Runtime::Logger.error(e)
+ end
+ end
+
desc "Merge and upload knapsack report"
task :upload, [:glob] do |_task, args|
QA::Support::KnapsackReport.configure!