145 lines
4.3 KiB
YAML
145 lines
4.3 KiB
YAML
# 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
|
|
if: $QA_FEATURE_FLAGS =~ /enabled|disabled/
|
|
|
|
|
|
# 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
|
|
|
|
# Run all tests when framework changes present, full suite execution is explicitly enabled or a feature flag file is removed
|
|
.qa-run-all-tests: &qa-run-all-tests
|
|
if: $QA_FRAMEWORK_CHANGES == "true" || $QA_RUN_ALL_TESTS == "true" || $QA_FEATURE_FLAGS =~ /deleted/
|
|
|
|
# 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"
|
|
|
|
.not-canonical-project: ¬-canonical-project
|
|
if: '$CI_PROJECT_PATH != "gitlab-org/gitlab" && $CI_PROJECT_PATH != "gitlab-cn/gitlab"'
|
|
|
|
# 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
|
|
|
|
.rules:dont-interrupt:
|
|
rules:
|
|
- if: '$CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH && $CI_MERGE_REQUEST_IID == null'
|
|
allow_failure: true
|
|
- if: '$CI_MERGE_REQUEST_EVENT_TYPE == "merged_result" || $CI_MERGE_REQUEST_EVENT_TYPE == "detached"'
|
|
when: manual
|
|
allow_failure: true
|
|
|
|
.rules:omnibus-build:
|
|
rules:
|
|
- if: $SKIP_OMNIBUS_TRIGGER == "true"
|
|
when: never
|
|
- when: always
|
|
|
|
.rules:update-cache:
|
|
rules:
|
|
- <<: *not-canonical-project
|
|
when: never
|
|
- when: always
|
|
|
|
# This job requires project access token with api permissions to detect parallel jobs,
|
|
# it is problematic to set for every project that would include this template
|
|
# Because parallel jobs themselves can download knapsack report, skip for non canonical runs
|
|
.rules:download-knapsack:
|
|
rules:
|
|
- <<: *not-canonical-project
|
|
when: never
|
|
- when: always
|
|
|
|
# ------------------------------------------
|
|
# Test
|
|
# ------------------------------------------
|
|
.rules:test:manual:
|
|
rules:
|
|
- when: manual
|
|
allow_failure: true
|
|
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
|
|
.rules:test:qa-selective:
|
|
rules:
|
|
# always run parallel with full suite when framework changes present or ff state changed
|
|
- <<: *qa-run-all-tests
|
|
when: never
|
|
- <<: *all-specs
|
|
when: never
|
|
- <<: *feature-flags-set
|
|
when: never
|
|
|
|
.rules:test:qa-parallel:
|
|
rules:
|
|
- *qa-run-all-tests
|
|
- <<: *specific-specs
|
|
when: manual
|
|
allow_failure: true
|
|
variables:
|
|
QA_TESTS: ""
|
|
- *feature-flags-set-manual
|
|
|
|
# general qa job rule for jobs without the need to run in parallel
|
|
.rules:test:qa:
|
|
rules:
|
|
- *qa-run-all-tests
|
|
- *feature-flags-set-manual
|
|
|
|
.rules:test:ee-only:
|
|
rules:
|
|
- if: $FOSS_ONLY == "true"
|
|
when: never
|
|
|
|
.rules:test:update:
|
|
rules:
|
|
# skip upgrade jobs if gitlab version is not in semver compatible format
|
|
# these jobs need gitlab version because we can't reliably detect it from just the image
|
|
- if: $GITLAB_SEMVER_VERSION !~ /^\d+\.\d+\.\d+/
|
|
when: never
|
|
- !reference [.rules:test:ee-only, rules]
|
|
- !reference [.rules:test:qa, rules]
|
|
|
|
# ------------------------------------------
|
|
# Report
|
|
# ------------------------------------------
|
|
.rules:report:allure-report:
|
|
rules:
|
|
- if: $SKIP_ALLURE_REPORT == "true"
|
|
when: never
|
|
- when: always
|
|
|
|
.rules:report:process-results:
|
|
rules:
|
|
- <<: *not-canonical-project
|
|
when: never
|
|
- *process-test-results
|