debian-mirror-gitlab/.gitlab/ci/review-apps/rules.gitlab-ci.yml

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

104 lines
3 KiB
YAML
Raw Normal View History

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 == ""
# No specific specs in mr pipeline
.all-specs-mr: &all-specs-mr
if: $CI_MERGE_REQUEST_IID && $QA_TESTS == ""
when: manual
# Triggered by change pattern
.app-changes: &app-changes
if: $APP_CHANGE_TRIGGER == "true"
2023-01-13 00:05:48 +05:30
# Run all tests when framework changes present or explicitly enabled full suite execution
.qa-run-all-tests: &qa-run-all-tests
if: $QA_FRAMEWORK_CHANGES == "true" || $QA_RUN_ALL_TESTS == "true"
2022-10-11 01:57:18 +05:30
2022-11-25 23:54:43 +05:30
.default-branch: &default-branch
if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH
.qa-manual: &qa-manual
when: manual
allow_failure: true
variables:
QA_TESTS: ""
2023-01-13 00:05:48 +05:30
.never-when-qa-run-all-tests-or-no-specific-specs:
- <<: *qa-run-all-tests
2022-10-11 01:57:18 +05:30
when: never
- <<: *all-specs
when: never
2023-01-13 00:05:48 +05:30
.never-when-specific-specs-always-when-qa-run-all-tests:
- *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
2022-11-25 23:54:43 +05:30
# ------------------------------------------
# Prepare
# ------------------------------------------
.rules:dont-interrupt:
rules:
- if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH
allow_failure: true
- if: $CI_MERGE_REQUEST_IID
when: manual
allow_failure: true
2022-10-11 01:57:18 +05:30
# ------------------------------------------
# Test
# ------------------------------------------
.rules:qa-smoke:
rules:
# always trigger smoke suite if review pipeline got triggered by specific changes in application code
- <<: *app-changes
variables:
2023-01-13 00:05:48 +05:30
QA_TESTS: "" # unset QA_TESTS even if specific tests were inferred from stage label
- *qa-run-all-tests
2022-10-11 01:57:18 +05:30
- if: $QA_SUITES =~ /Test::Instance::Smoke/
2022-11-25 23:54:43 +05:30
- *qa-manual
2022-10-11 01:57:18 +05:30
.rules:qa-blocking:
rules:
- <<: *app-changes
when: never
2023-01-13 00:05:48 +05:30
- !reference [.never-when-qa-run-all-tests-or-no-specific-specs]
2022-10-11 01:57:18 +05:30
- if: $QA_SUITES =~ /Test::Instance::ReviewBlocking/
.rules:qa-blocking-parallel:
rules:
# always trigger blocking suite if review pipeline got triggered by specific changes in application code
- <<: *app-changes
variables:
2023-01-13 00:05:48 +05:30
QA_TESTS: "" # unset QA_TESTS even if specific tests were inferred from stage label
- !reference [.never-when-specific-specs-always-when-qa-run-all-tests]
2022-10-11 01:57:18 +05:30
- if: $QA_SUITES =~ /Test::Instance::ReviewBlocking/
.rules:qa-non-blocking:
rules:
2023-01-13 00:05:48 +05:30
- !reference [.never-when-qa-run-all-tests-or-no-specific-specs]
2022-10-11 01:57:18 +05:30
- if: $QA_SUITES =~ /Test::Instance::ReviewNonBlocking/
.rules:qa-non-blocking-parallel:
rules:
2023-01-13 00:05:48 +05:30
- !reference [.never-when-specific-specs-always-when-qa-run-all-tests]
- *all-specs-mr # set full suite to manual when no specific specs passed in mr
2022-10-11 01:57:18 +05:30
- if: $QA_SUITES =~ /Test::Instance::ReviewNonBlocking/
# ------------------------------------------
# Prepare/Report
# ------------------------------------------
2022-11-25 23:54:43 +05:30
.rules:prepare-report:
2022-10-11 01:57:18 +05:30
rules:
2022-11-25 23:54:43 +05:30
- when: always
2023-01-13 00:05:48 +05:30
.rules:main-run:
2022-11-25 23:54:43 +05:30
rules:
2023-01-13 00:05:48 +05:30
- *default-branch