debian-mirror-gitlab/.gitlab/ci/qa.gitlab-ci.yml

127 lines
3.2 KiB
YAML
Raw Normal View History

2019-12-21 20:55:43 +05:30
.qa-job-base:
extends:
- .default-retry
2020-06-23 00:09:42 +05:30
- .qa-cache
2019-12-21 20:55:43 +05:30
stage: test
2020-04-08 14:13:33 +05:30
needs: []
2021-06-08 01:23:25 +05:30
variables:
USE_BUNDLE_INSTALL: "false"
SETUP_DB: "false"
2021-11-11 11:23:49 +05:30
QA_EXPORT_TEST_METRICS: "false"
2019-12-21 20:55:43 +05:30
before_script:
2021-06-08 01:23:25 +05:30
- !reference [.default-before_script, before_script]
2019-12-21 20:55:43 +05:30
- cd qa/
2021-06-08 01:23:25 +05:30
- bundle_install_script
2019-12-21 20:55:43 +05:30
qa:internal:
2020-03-13 15:44:24 +05:30
extends:
- .qa-job-base
- .qa:rules:ee-and-foss
script:
- bundle exec rspec
qa:internal-as-if-foss:
extends:
2020-06-23 00:09:42 +05:30
- qa:internal
2020-05-24 23:13:21 +05:30
- .qa:rules:as-if-foss
2020-03-13 15:44:24 +05:30
- .as-if-foss
2019-12-21 20:55:43 +05:30
qa:selectors:
2020-03-13 15:44:24 +05:30
extends:
- .qa-job-base
- .qa:rules:ee-and-foss
2019-12-21 20:55:43 +05:30
script:
- bundle exec bin/qa Test::Sanity::Selectors
2020-03-13 15:44:24 +05:30
qa:selectors-as-if-foss:
2019-12-21 20:55:43 +05:30
extends:
- qa:selectors
2020-05-24 23:13:21 +05:30
- .qa:rules:as-if-foss
2020-03-13 15:44:24 +05:30
- .as-if-foss
2019-12-21 20:55:43 +05:30
2020-06-23 00:09:42 +05:30
update-qa-cache:
extends:
- .qa-job-base
2021-06-08 01:23:25 +05:30
- .qa-cache-push
2020-06-23 00:09:42 +05:30
- .shared:rules:update-cache
stage: prepare
script:
- echo "Cache has been updated and ready to be uploaded."
2019-10-12 21:52:04 +05:30
.package-and-qa-base:
2021-03-11 19:13:27 +05:30
image: ${GITLAB_DEPENDENCY_PROXY}ruby:2.7-alpine
2019-12-04 20:38:33 +05:30
stage: qa
2019-07-31 22:56:46 +05:30
retry: 0
2021-10-27 15:23:28 +05:30
before_script:
2019-07-31 22:56:46 +05:30
- source scripts/utils.sh
- install_gitlab_gem
2021-12-11 22:18:48 +05:30
- tooling/bin/find_change_diffs ${CHANGES_DIFFS_DIR}
2021-10-27 15:23:28 +05:30
script:
2022-01-26 12:08:38 +05:30
- tooling/bin/qa/check_if_qa_only_spec_changes ${CHANGES_FILE} ${ONLY_QA_CHANGES_FILE}
- '[ -f $ONLY_QA_CHANGES_FILE ] && export QA_TESTS="`cat $ONLY_QA_CHANGES_FILE`"'
- 'echo "QA_TESTS: $QA_TESTS"'
- exit_code=0 && tooling/bin/qa/package_and_qa_check ${CHANGES_DIFFS_DIR} || exit_code=$?
- echo $exit_code
2021-12-11 22:18:48 +05:30
- |
if [ $exit_code -eq 0 ]; then
./scripts/trigger-build omnibus
elif [ $exit_code -eq 1 ]; then
exit 1
else
echo "Downstream jobs will not be triggered because package_and_qa_check exited with code: $exit_code"
fi
# These jobs often time out, so temporarily use private runners and a long timeout: https://gitlab.com/gitlab-org/gitlab/-/issues/238563
2020-10-24 23:57:45 +05:30
tags:
- prm
timeout: 4h
2020-04-22 19:07:51 +05:30
needs:
- job: build-qa-image
artifacts: false
2020-05-24 23:13:21 +05:30
- job: build-assets-image
2020-04-22 19:07:51 +05:30
artifacts: false
2021-12-11 22:18:48 +05:30
- detect-tests
artifacts:
expire_in: 7d
paths:
- ${CHANGES_FILE}
2022-01-26 12:08:38 +05:30
- ${ONLY_QA_CHANGES_FILE}
2021-12-11 22:18:48 +05:30
- ${CHANGES_DIFFS_DIR}/*
variables:
CHANGES_FILE: tmp/changed_files.txt
2022-01-26 12:08:38 +05:30
ONLY_QA_CHANGES_FILE: tmp/qa_only_changed_files.txt
2021-12-11 22:18:48 +05:30
CHANGES_DIFFS_DIR: tmp/diffs
2022-01-26 12:08:38 +05:30
ALLURE_JOB_NAME: $CI_JOB_NAME
2021-12-11 22:18:48 +05:30
.package-and-qa-ff-base:
script:
2022-01-26 12:08:38 +05:30
- |
feature_flags=$(scripts/changed-feature-flags --files $(cat $CHANGES_FILE | tr ' ' ',') --state $QA_FF_STATE)
if [[ $feature_flags ]]; then
export GITLAB_QA_OPTIONS="--set-feature-flags $feature_flags"
echo $GITLAB_QA_OPTIONS
./scripts/trigger-build omnibus
else
echo "No changed feature flag found to test. The tests are skipped if the flag was removed."
fi
2021-12-11 22:18:48 +05:30
package-and-qa:
extends:
- .package-and-qa-base
- .qa:rules:package-and-qa
package-and-qa-ff-enabled:
extends:
- .package-and-qa-base
- .package-and-qa-ff-base
- .qa:rules:package-and-qa:feature-flags
variables:
QA_FF_STATE: "enable"
package-and-qa-ff-disabled:
extends:
- .package-and-qa-base
- .package-and-qa-ff-base
- .qa:rules:package-and-qa:feature-flags
variables:
QA_FF_STATE: "disable"