2019-10-10 14:06:00 -04:00
|
|
|
.qa-job-base:
|
|
|
|
extends:
|
|
|
|
- .default-retry
|
2020-06-02 08:08:33 -04:00
|
|
|
- .qa-cache
|
2019-10-10 14:06:00 -04:00
|
|
|
stage: test
|
2020-02-20 13:08:51 -05:00
|
|
|
needs: []
|
2021-05-14 14:10:34 -04:00
|
|
|
variables:
|
|
|
|
USE_BUNDLE_INSTALL: "false"
|
|
|
|
SETUP_DB: "false"
|
2021-09-07 08:11:26 -04:00
|
|
|
QA_EXPORT_TEST_METRICS: "false"
|
2019-10-10 14:06:00 -04:00
|
|
|
before_script:
|
2021-05-14 14:10:34 -04:00
|
|
|
- !reference [.default-before_script, before_script]
|
2019-10-10 14:06:00 -04:00
|
|
|
- cd qa/
|
2021-05-14 14:10:34 -04:00
|
|
|
- bundle_install_script
|
2019-10-10 14:06:00 -04:00
|
|
|
|
|
|
|
qa:internal:
|
2020-02-06 13:08:54 -05:00
|
|
|
extends:
|
|
|
|
- .qa-job-base
|
|
|
|
- .qa:rules:ee-and-foss
|
2019-10-10 14:06:00 -04:00
|
|
|
script:
|
|
|
|
- bundle exec rspec
|
|
|
|
|
2020-02-18 10:08:51 -05:00
|
|
|
qa:internal-as-if-foss:
|
2020-01-23 07:08:38 -05:00
|
|
|
extends:
|
2020-06-02 08:08:33 -04:00
|
|
|
- qa:internal
|
2020-05-15 11:08:04 -04:00
|
|
|
- .qa:rules:as-if-foss
|
2020-02-06 13:08:54 -05:00
|
|
|
- .as-if-foss
|
2020-01-23 07:08:38 -05:00
|
|
|
|
2019-10-10 14:06:00 -04:00
|
|
|
qa:selectors:
|
2020-02-06 13:08:54 -05:00
|
|
|
extends:
|
|
|
|
- .qa-job-base
|
|
|
|
- .qa:rules:ee-and-foss
|
2019-10-10 14:06:00 -04:00
|
|
|
script:
|
|
|
|
- bundle exec bin/qa Test::Sanity::Selectors
|
|
|
|
|
2022-01-19 10:14:05 -05:00
|
|
|
qa:auto_quarantine:
|
|
|
|
extends:
|
|
|
|
- .qa-job-base
|
|
|
|
rules:
|
|
|
|
- if: '$QA_TRIGGER_AUTO_QUARANTINE =~ /true|yes|1/i'
|
|
|
|
script:
|
|
|
|
- bundle exec confiner -r .confiner/quarantine.yml
|
|
|
|
allow_failure: true
|
|
|
|
|
2020-02-18 10:08:51 -05:00
|
|
|
qa:selectors-as-if-foss:
|
2019-10-10 14:06:00 -04:00
|
|
|
extends:
|
|
|
|
- qa:selectors
|
2020-05-15 11:08:04 -04:00
|
|
|
- .qa:rules:as-if-foss
|
2020-02-06 13:08:54 -05:00
|
|
|
- .as-if-foss
|
2019-10-10 14:06:00 -04:00
|
|
|
|
2020-06-02 08:08:33 -04:00
|
|
|
update-qa-cache:
|
|
|
|
extends:
|
|
|
|
- .qa-job-base
|
2021-05-18 08:10:26 -04:00
|
|
|
- .qa-cache-push
|
2020-06-02 08:08:33 -04:00
|
|
|
- .shared:rules:update-cache
|
|
|
|
stage: prepare
|
|
|
|
script:
|
|
|
|
- echo "Cache has been updated and ready to be uploaded."
|
|
|
|
|
2019-08-01 06:23:15 -04:00
|
|
|
.package-and-qa-base:
|
2021-02-03 13:09:25 -05:00
|
|
|
image: ${GITLAB_DEPENDENCY_PROXY}ruby:2.7-alpine
|
2019-08-22 02:04:39 -04:00
|
|
|
stage: qa
|
2019-04-12 04:56:38 -04:00
|
|
|
retry: 0
|
2021-07-21 14:09:27 -04:00
|
|
|
before_script:
|
2019-04-18 15:18:20 -04:00
|
|
|
- source scripts/utils.sh
|
|
|
|
- install_gitlab_gem
|
2021-11-04 08:10:22 -04:00
|
|
|
- tooling/bin/find_change_diffs ${CHANGES_DIFFS_DIR}
|
2021-07-21 14:09:27 -04:00
|
|
|
script:
|
2021-12-13 19:14:57 -05:00
|
|
|
- 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-11-04 08:10:22 -04:00
|
|
|
- |
|
2021-11-08 07:12:07 -05:00
|
|
|
if [ $exit_code -eq 0 ]; then
|
2021-11-04 08:10:22 -04:00
|
|
|
./scripts/trigger-build omnibus
|
2021-11-08 07:12:07 -05:00
|
|
|
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"
|
2021-11-04 08:10:22 -04:00
|
|
|
fi
|
2021-10-18 20:10:29 -04:00
|
|
|
# These jobs often time out, so temporarily use private runners and a long timeout: https://gitlab.com/gitlab-org/gitlab/-/issues/238563
|
2020-08-19 14:10:34 -04:00
|
|
|
tags:
|
|
|
|
- prm
|
|
|
|
timeout: 4h
|
2020-03-19 11:09:41 -04:00
|
|
|
needs:
|
|
|
|
- job: build-qa-image
|
|
|
|
artifacts: false
|
2020-05-14 23:08:10 -04:00
|
|
|
- job: build-assets-image
|
2020-03-19 11:09:41 -04:00
|
|
|
artifacts: false
|
2021-10-18 20:10:29 -04:00
|
|
|
- detect-tests
|
2021-11-04 08:10:22 -04:00
|
|
|
artifacts:
|
|
|
|
expire_in: 7d
|
|
|
|
paths:
|
|
|
|
- ${CHANGES_FILE}
|
2021-12-02 22:14:42 -05:00
|
|
|
- ${ONLY_QA_CHANGES_FILE}
|
2021-11-04 08:10:22 -04:00
|
|
|
- ${CHANGES_DIFFS_DIR}/*
|
2021-10-18 20:10:29 -04:00
|
|
|
variables:
|
2021-11-04 08:10:22 -04:00
|
|
|
CHANGES_FILE: tmp/changed_files.txt
|
2021-12-02 22:14:42 -05:00
|
|
|
ONLY_QA_CHANGES_FILE: tmp/qa_only_changed_files.txt
|
2021-11-04 08:10:22 -04:00
|
|
|
CHANGES_DIFFS_DIR: tmp/diffs
|
2021-12-13 16:14:32 -05:00
|
|
|
ALLURE_JOB_NAME: $CI_JOB_NAME
|
2021-11-04 08:10:22 -04:00
|
|
|
|
|
|
|
.package-and-qa-ff-base:
|
2021-10-18 20:10:29 -04:00
|
|
|
script:
|
2021-11-23 13:12:49 -05:00
|
|
|
- |
|
|
|
|
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-10-18 20:10:29 -04:00
|
|
|
|
|
|
|
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"
|