Skip to content
Snippets Groups Projects
Unverified Commit aaa7711e authored by Daniel Davison's avatar Daniel Davison Committed by GitLab
Browse files

Merge branch 'andrey-fix-parallel-selective-setup' into 'master'

Fix incorrect setup of KNAPSACK_TEST_FILE_PATTERN for selective e2e test execution

See merge request https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169397



Merged-by: default avatarDan Davison <ddavison@gitlab.com>
Approved-by: default avatarDan Davison <ddavison@gitlab.com>
Co-authored-by: default avatarAndrejs Cunskis <acunskis@gitlab.com>
parents 1c8e6710 fa81bda6
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -38,13 +38,13 @@ namespace :ci do
append_to_file(env_file, "QA_SKIP_ALL_TESTS=true")
end
 
# on run-all label of framework changes do not infer specific tests
# on run-all label or 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 or exceeds certain size, use KNAPSACK_FILE_PATTERN to limit what specs to run
files_pattern = ""
files_pattern = nil
tests_array = tests&.split(' ')
if tests_array&.none? { |item| item.include?('_spec') }
if tests_array&.none? { |item| item.include?('_spec.rb') }
test_paths = tests_array.map { |item| "#{item}**/*" }
 
files_pattern = "{#{test_paths.join(',')}}"
Loading
Loading
@@ -55,12 +55,6 @@ namespace :ci do
tests = nil # Unset QA_TESTS when KNAPSACK_FILE_PATTERN is set
end
 
logger.info(" Files pattern for tests: #{files_pattern}")
append_to_file(env_file, <<~TXT)
KNAPSACK_TEST_FILE_PATTERN='#{files_pattern}'
TXT
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")
Loading
Loading
@@ -70,6 +64,7 @@ namespace :ci do
elsif tests
logger.info(" detected following specs to execute: '#{tests}'")
elsif files_pattern
append_to_file(env_file, "KNAPSACK_TEST_FILE_PATTERN='#{files_pattern}'\n")
logger.info(" detected following specs to execute in parallel: '#{files_pattern}'")
else
logger.info(" no specific specs to execute detected")
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment