2022-10-11 01:57:18 +05:30
|
|
|
# Specific specs passed
|
|
|
|
.specific-specs: &specific-specs
|
|
|
|
if: $QA_TESTS != ""
|
|
|
|
|
|
|
|
# No specific specs passed
|
|
|
|
.all-specs: &all-specs
|
|
|
|
if: $QA_TESTS == ""
|
|
|
|
|
|
|
|
# FF changes
|
|
|
|
.feature-flags-set: &feature-flags-set
|
2023-01-13 00:05:48 +05:30
|
|
|
if: $QA_FEATURE_FLAGS =~ /enabled|disabled/
|
2022-10-11 01:57:18 +05:30
|
|
|
|
|
|
|
# Manually trigger job on ff changes but with default ff state instead of inverted
|
|
|
|
.feature-flags-set-manual: &feature-flags-set-manual
|
|
|
|
<<: *feature-flags-set
|
|
|
|
when: manual
|
|
|
|
allow_failure: true
|
|
|
|
|
2023-06-20 00:43:36 +05:30
|
|
|
# Run the job on master pipeline
|
|
|
|
.default-branch: &default-branch
|
|
|
|
if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
|
|
|
|
|
|
|
|
# Run all tests when QA framework changes present, full suite execution is explicitly enabled or a feature flag file is removed
|
2023-01-13 00:05:48 +05:30
|
|
|
.qa-run-all-tests: &qa-run-all-tests
|
2023-06-20 00:43:36 +05:30
|
|
|
if: $QA_FRAMEWORK_CHANGES == "true" || $QA_RUN_ALL_TESTS == "true" || $QA_RUN_ALL_E2E_LABEL == "true" || $QA_FEATURE_FLAGS =~ /deleted/
|
|
|
|
|
|
|
|
# Run job when MR has pipeline:run-all-e2e label
|
|
|
|
.qa-run-all-e2e-label: &qa-run-all-e2e-label
|
|
|
|
if: $QA_RUN_ALL_E2E_LABEL == "true"
|
2022-10-11 01:57:18 +05:30
|
|
|
|
|
|
|
# Process test results (notify failure to slack, create test session report, relate test failures)
|
|
|
|
.process-test-results: &process-test-results
|
|
|
|
if: $PROCESS_TEST_RESULTS == "true"
|
|
|
|
|
2023-01-13 00:05:48 +05:30
|
|
|
.not-canonical-project: ¬-canonical-project
|
|
|
|
if: '$CI_PROJECT_PATH != "gitlab-org/gitlab" && $CI_PROJECT_PATH != "gitlab-cn/gitlab"'
|
|
|
|
|
2022-10-11 01:57:18 +05:30
|
|
|
# Selective test execution against omnibus instance have following execution scenarios:
|
|
|
|
# * only e2e spec files changed - runs only changed specs
|
|
|
|
# * qa framework changes - runs full test suite
|
|
|
|
# * feature flag changed - runs full test suite with base gitlab instance configuration with both ff states
|
|
|
|
# * quarantined e2e spec - skips execution of e2e tests by creating a no-op pipeline
|
|
|
|
|
|
|
|
# ------------------------------------------
|
|
|
|
# Prepare
|
|
|
|
# ------------------------------------------
|
|
|
|
.rules:prepare:
|
|
|
|
rules:
|
|
|
|
- when: always
|
|
|
|
|
2022-11-25 23:54:43 +05:30
|
|
|
.rules:omnibus-build:
|
|
|
|
rules:
|
|
|
|
- if: $SKIP_OMNIBUS_TRIGGER == "true"
|
|
|
|
when: never
|
2023-06-20 00:43:36 +05:30
|
|
|
- if: $FOSS_ONLY != "1"
|
2022-11-25 23:54:43 +05:30
|
|
|
|
2023-06-20 00:43:36 +05:30
|
|
|
.rules:omnibus-build-ce:
|
2023-01-13 00:05:48 +05:30
|
|
|
rules:
|
2023-06-20 00:43:36 +05:30
|
|
|
- if: $SKIP_OMNIBUS_TRIGGER == "true"
|
2023-01-13 00:05:48 +05:30
|
|
|
when: never
|
2023-06-20 00:43:36 +05:30
|
|
|
- if: $FOSS_ONLY == "1"
|
|
|
|
|
|
|
|
.rules:update-cache:
|
|
|
|
rules:
|
|
|
|
- if: '$UPDATE_QA_CACHE == "true"'
|
2023-01-13 00:05:48 +05:30
|
|
|
|
2023-04-23 21:23:45 +05:30
|
|
|
.rules:download-knapsack:
|
|
|
|
rules:
|
|
|
|
- when: always
|
|
|
|
|
2022-10-11 01:57:18 +05:30
|
|
|
# ------------------------------------------
|
|
|
|
# Test
|
|
|
|
# ------------------------------------------
|
2022-11-25 23:54:43 +05:30
|
|
|
.rules:test:manual:
|
2022-10-11 01:57:18 +05:30
|
|
|
rules:
|
|
|
|
- when: manual
|
2022-11-25 23:54:43 +05:30
|
|
|
allow_failure: true
|
2022-10-11 01:57:18 +05:30
|
|
|
variables:
|
|
|
|
QA_TESTS: ""
|
|
|
|
|
|
|
|
.rules:test:feature-flags-set:
|
|
|
|
rules:
|
|
|
|
# unset specific specs if pipeline has feature flag changes and run full suite
|
|
|
|
- <<: *feature-flags-set
|
|
|
|
variables:
|
|
|
|
QA_TESTS: ""
|
|
|
|
|
|
|
|
# parallel and non parallel rules are used for jobs that require parallel execution and thus need to switch
|
|
|
|
# between parallel and non parallel when only certain specs are executed
|
2023-04-23 21:23:45 +05:30
|
|
|
.rules:test:qa-selective:
|
2022-10-11 01:57:18 +05:30
|
|
|
rules:
|
|
|
|
# always run parallel with full suite when framework changes present or ff state changed
|
2023-01-13 00:05:48 +05:30
|
|
|
- <<: *qa-run-all-tests
|
2022-10-11 01:57:18 +05:30
|
|
|
when: never
|
|
|
|
- <<: *all-specs
|
|
|
|
when: never
|
|
|
|
- <<: *feature-flags-set
|
|
|
|
when: never
|
|
|
|
|
|
|
|
.rules:test:qa-parallel:
|
|
|
|
rules:
|
2023-01-13 00:05:48 +05:30
|
|
|
- *qa-run-all-tests
|
2022-10-11 01:57:18 +05:30
|
|
|
- <<: *specific-specs
|
2022-11-25 23:54:43 +05:30
|
|
|
when: manual
|
|
|
|
allow_failure: true
|
|
|
|
variables:
|
|
|
|
QA_TESTS: ""
|
2022-10-11 01:57:18 +05:30
|
|
|
- *feature-flags-set-manual
|
|
|
|
|
|
|
|
# general qa job rule for jobs without the need to run in parallel
|
|
|
|
.rules:test:qa:
|
|
|
|
rules:
|
2023-01-13 00:05:48 +05:30
|
|
|
- *qa-run-all-tests
|
2022-10-11 01:57:18 +05:30
|
|
|
- *feature-flags-set-manual
|
|
|
|
|
2023-05-27 22:25:52 +05:30
|
|
|
.rules:test:ee-only:
|
|
|
|
rules:
|
2023-06-20 00:43:36 +05:30
|
|
|
- if: $FOSS_ONLY == "1"
|
2023-05-27 22:25:52 +05:30
|
|
|
when: never
|
|
|
|
|
2022-11-25 23:54:43 +05:30
|
|
|
.rules:test:update:
|
|
|
|
rules:
|
2023-05-27 22:25:52 +05:30
|
|
|
# skip upgrade jobs if gitlab version is not in semver compatible format
|
2022-11-25 23:54:43 +05:30
|
|
|
# these jobs need gitlab version because we can't reliably detect it from just the image
|
2023-05-27 22:25:52 +05:30
|
|
|
- if: $GITLAB_SEMVER_VERSION !~ /^\d+\.\d+\.\d+/
|
2022-11-25 23:54:43 +05:30
|
|
|
when: never
|
2023-07-09 08:55:56 +05:30
|
|
|
# update type tests are used to check if gitlab upgrade can be performed correctly (mainly migrations)
|
|
|
|
# there isn't much benefit in running tests after update with new sidebar enabled and there
|
|
|
|
# is also an issue to properly pass feature toggle to this job due to how gitlab-qa parses cli args
|
|
|
|
- if: $QA_SUPER_SIDEBAR_ENABLED == "true"
|
|
|
|
when: never
|
2023-05-27 22:25:52 +05:30
|
|
|
- !reference [.rules:test:ee-only, rules]
|
2022-11-25 23:54:43 +05:30
|
|
|
- !reference [.rules:test:qa, rules]
|
|
|
|
|
2023-06-20 00:43:36 +05:30
|
|
|
.rules:test:qa-default-branch:
|
|
|
|
rules:
|
|
|
|
- *qa-run-all-e2e-label
|
|
|
|
- *default-branch
|
|
|
|
- *feature-flags-set-manual
|
|
|
|
|
2022-10-11 01:57:18 +05:30
|
|
|
# ------------------------------------------
|
|
|
|
# Report
|
|
|
|
# ------------------------------------------
|
|
|
|
.rules:report:allure-report:
|
|
|
|
rules:
|
2022-11-25 23:54:43 +05:30
|
|
|
- if: $SKIP_ALLURE_REPORT == "true"
|
|
|
|
when: never
|
2022-10-11 01:57:18 +05:30
|
|
|
- when: always
|
|
|
|
|
|
|
|
.rules:report:process-results:
|
|
|
|
rules:
|
2023-01-13 00:05:48 +05:30
|
|
|
- <<: *not-canonical-project
|
|
|
|
when: never
|
2022-10-11 01:57:18 +05:30
|
|
|
- *process-test-results
|