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

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

205 lines
5.6 KiB
YAML
Raw Normal View History

2022-06-21 17:19:12 +05:30
include:
- project: gitlab-org/quality/pipeline-common
2023-01-13 00:05:48 +05:30
ref: 1.7.0
2022-06-21 17:19:12 +05:30
file:
2022-11-25 23:54:43 +05:30
- /ci/base.gitlab-ci.yml
2022-06-21 17:19:12 +05:30
- /ci/allure-report.yml
- /ci/knapsack-report.yml
2022-08-13 15:12:31 +05:30
.test-variables:
2021-11-18 22:05:49 +05:30
variables:
QA_GENERATE_ALLURE_REPORT: "true"
2022-10-11 01:57:18 +05:30
QA_CAN_TEST_PRAEFECT: "false"
2021-11-18 22:05:49 +05:30
GITLAB_USERNAME: "root"
GITLAB_PASSWORD: "${REVIEW_APPS_ROOT_PASSWORD}"
GITLAB_ADMIN_USERNAME: "root"
GITLAB_ADMIN_PASSWORD: "${REVIEW_APPS_ROOT_PASSWORD}"
2021-12-11 22:18:48 +05:30
GITLAB_QA_ADMIN_ACCESS_TOKEN: "${REVIEW_APPS_ROOT_TOKEN}"
2022-10-11 01:57:18 +05:30
GITHUB_ACCESS_TOKEN: "${QA_GITHUB_ACCESS_TOKEN}"
2022-07-16 23:28:13 +05:30
2022-08-13 15:12:31 +05:30
.bundle-base:
extends:
- .qa-cache
image: ${REGISTRY_HOST}/${REGISTRY_GROUP}/gitlab-build-images/debian-bullseye-ruby-${RUBY_VERSION}:bundler-2.3
before_script:
- cd qa && bundle install
2022-07-16 23:28:13 +05:30
.review-qa-base:
2023-01-13 00:05:48 +05:30
image: ${REGISTRY_HOST}/${REGISTRY_GROUP}/gitlab-build-images/debian-bullseye-ruby-${RUBY_VERSION}:bundler-2.3-git-2.36-lfs-2.9-chrome-${CHROME_VERSION}-docker-${DOCKER_VERSION}-gcloud-383-kubectl-1.23
2022-07-16 23:28:13 +05:30
extends:
- .use-docker-in-docker
2022-08-13 15:12:31 +05:30
- .bundle-base
- .test-variables
2022-07-16 23:28:13 +05:30
stage: qa
needs:
- review-deploy
- download-knapsack-report
variables:
2022-08-13 15:12:31 +05:30
GIT_LFS_SKIP_SMUDGE: 1
WD_INSTALL_DIR: /usr/local/bin
2022-10-11 01:57:18 +05:30
RSPEC_REPORT_OPTS: --force-color --order random --format documentation --format RspecJunitFormatter --out tmp/rspec-${CI_JOB_ID}.xml
2021-12-11 22:18:48 +05:30
script:
2022-08-13 15:12:31 +05:30
- export EE_LICENSE="$(cat $REVIEW_APPS_EE_LICENSE_FILE)"
2022-10-11 01:57:18 +05:30
- QA_COMMAND="bundle exec bin/qa ${QA_SCENARIO} ${QA_GITLAB_URL} -- ${QA_TESTS} ${RSPEC_REPORT_OPTS}"
- echo "Running - '${QA_COMMAND}'"
- eval "$QA_COMMAND"
after_script:
2022-07-16 23:28:13 +05:30
- |
2022-10-11 01:57:18 +05:30
echo "Sentry errors for the current review-app test run can be found via following url:"
echo "https://sentry.gitlab.net/gitlab/gitlab-review-apps/releases/$(echo "${CI_COMMIT_SHA}" | cut -c1-11)/all-events/."
2021-12-11 22:18:48 +05:30
artifacts:
2022-01-26 12:08:38 +05:30
paths:
2022-03-02 08:16:31 +05:30
- qa/tmp
2021-12-11 22:18:48 +05:30
reports:
2022-10-11 01:57:18 +05:30
junit: qa/tmp/rspec-*.xml
2022-03-02 08:16:31 +05:30
expire_in: 7 days
when: always
2022-07-16 23:28:13 +05:30
# Store knapsack report as artifact so the same report is reused across all jobs
download-knapsack-report:
extends:
2022-08-13 15:12:31 +05:30
- .bundle-base
2022-11-25 23:54:43 +05:30
- .rules:prepare-report
2022-07-16 23:28:13 +05:30
stage: prepare
script:
2022-08-27 11:52:29 +05:30
- bundle exec rake "knapsack:download[qa]"
2022-07-16 23:28:13 +05:30
allow_failure: true
artifacts:
paths:
- qa/knapsack/review-qa-*.json
expire_in: 1 day
2021-11-18 22:05:49 +05:30
review-qa-smoke:
extends:
- .review-qa-base
2022-10-11 01:57:18 +05:30
- .rules:qa-smoke
2021-11-18 22:05:49 +05:30
variables:
2022-10-11 01:57:18 +05:30
QA_SCENARIO: Test::Instance::Smoke
2021-11-18 22:05:49 +05:30
QA_RUN_TYPE: review-qa-smoke
2022-10-11 01:57:18 +05:30
retry: 1
2021-11-18 22:05:49 +05:30
2022-10-11 01:57:18 +05:30
review-qa-blocking:
2021-12-11 22:18:48 +05:30
extends:
- .review-qa-base
2022-10-11 01:57:18 +05:30
- .rules:qa-blocking
variables:
QA_SCENARIO: Test::Instance::ReviewBlocking
QA_RUN_TYPE: review-qa-blocking
2022-07-23 23:45:48 +05:30
retry: 1
2022-10-11 01:57:18 +05:30
review-qa-blocking-parallel:
extends:
- review-qa-blocking
- .rules:qa-blocking-parallel
2022-07-16 23:28:13 +05:30
parallel: 10
2021-12-11 22:18:48 +05:30
2022-10-11 01:57:18 +05:30
review-qa-non-blocking:
2021-11-18 22:05:49 +05:30
extends:
- .review-qa-base
2022-10-11 01:57:18 +05:30
- .rules:qa-non-blocking
2021-11-18 22:05:49 +05:30
variables:
2022-10-11 01:57:18 +05:30
QA_SCENARIO: Test::Instance::ReviewNonBlocking
QA_RUN_TYPE: review-qa-non-blocking
2023-03-04 22:38:38 +05:30
when: manual
2022-10-11 01:57:18 +05:30
allow_failure: true
review-qa-non-blocking-parallel:
extends:
- review-qa-non-blocking
- .rules:qa-non-blocking-parallel
parallel: 5
2021-11-18 22:05:49 +05:30
review-performance:
extends:
- .default-retry
- .review:rules:review-performance
image:
name: sitespeedio/sitespeed.io
entrypoint: [""]
stage: qa
needs: ["review-deploy"]
before_script:
- export CI_ENVIRONMENT_URL="$(cat environment_url.txt)"
- echo "${CI_ENVIRONMENT_URL}"
- mkdir -p gitlab-exporter
- wget -O ./gitlab-exporter/index.js https://gitlab.com/gitlab-org/gl-performance/raw/master/index.js
- mkdir -p sitespeed-results
script:
- /start.sh --plugins.add ./gitlab-exporter --outputFolder sitespeed-results "${CI_ENVIRONMENT_URL}"
after_script:
- mv sitespeed-results/data/performance.json performance.json
artifacts:
paths:
- sitespeed-results/
reports:
performance: performance.json
expire_in: 31d
2022-10-11 01:57:18 +05:30
e2e-test-report:
2021-11-18 22:05:49 +05:30
extends:
2022-10-11 01:57:18 +05:30
- .generate-allure-report-base
2022-11-25 23:54:43 +05:30
- .rules:prepare-report
2022-10-11 01:57:18 +05:30
stage: post-qa
2021-11-18 22:05:49 +05:30
variables:
2022-10-11 01:57:18 +05:30
ALLURE_JOB_NAME: e2e-review-qa
ALLURE_PROJECT_PATH: $CI_PROJECT_PATH
2023-01-13 00:05:48 +05:30
ALLURE_RESULTS_GLOB: qa/tmp/allure-results
2022-10-11 01:57:18 +05:30
ALLURE_MERGE_REQUEST_IID: $CI_MERGE_REQUEST_IID
GITLAB_AUTH_TOKEN: $GITLAB_QA_MR_ALLURE_REPORT_TOKEN
GIT_STRATEGY: none
allow_failure: true
when: always
2023-01-13 00:05:48 +05:30
artifacts: # re-save rspec results for displaying in parent pipeline
2022-10-11 01:57:18 +05:30
expire_in: 1 day
when: always
paths:
- qa/tmp/rspec-*.xml
2022-01-26 12:08:38 +05:30
2022-07-16 23:28:13 +05:30
upload-knapsack-report:
2022-01-26 12:08:38 +05:30
extends:
2022-06-21 17:19:12 +05:30
- .generate-knapsack-report-base
2022-08-13 15:12:31 +05:30
- .bundle-base
2022-03-02 08:16:31 +05:30
stage: post-qa
2022-06-21 17:19:12 +05:30
variables:
2022-07-16 23:28:13 +05:30
QA_KNAPSACK_REPORT_FILE_PATTERN: $CI_PROJECT_DIR/qa/tmp/knapsack/*/*.json
2022-08-13 15:12:31 +05:30
delete-test-resources:
extends:
- .bundle-base
2022-11-25 23:54:43 +05:30
- .rules:prepare-report
2022-08-13 15:12:31 +05:30
stage: post-qa
variables:
QA_TEST_RESOURCES_FILE_PATTERN: $CI_PROJECT_DIR/qa/tmp/test-resources-*.json
GITLAB_QA_ACCESS_TOKEN: $REVIEW_APPS_ROOT_TOKEN
script:
- export GITLAB_ADDRESS="$QA_GITLAB_URL"
- bundle exec rake "test_resources:delete[$QA_TEST_RESOURCES_FILE_PATTERN]"
allow_failure: true
2022-10-11 01:57:18 +05:30
when: always
2022-11-25 23:54:43 +05:30
notify-slack:
extends:
- .notify-slack-qa
- .qa-cache
2023-01-13 00:05:48 +05:30
- .rules:main-run
2022-11-25 23:54:43 +05:30
stage: post-qa
variables:
RUN_WITH_BUNDLE: "true"
QA_PATH: qa
ALLURE_JOB_NAME: e2e-review-qa
SLACK_ICON_EMOJI: ci_failing
STATUS_SYM: ☠️
STATUS: failed
TYPE: "(review-app) "
2023-01-13 00:05:48 +05:30
when: on_failure
2022-11-25 23:54:43 +05:30
script:
2023-01-13 00:05:48 +05:30
- bundle exec gitlab-qa-report --prepare-stage-reports "$CI_PROJECT_DIR/qa/tmp/rspec-*.xml" # generate summary
2022-11-25 23:54:43 +05:30
- !reference [.notify-slack-qa, script]
2023-01-13 00:05:48 +05:30
export-test-metrics:
extends:
- .bundle-base
- .rules:main-run
stage: post-qa
when: always
script:
- bundle exec rake "ci:export_test_metrics[tmp/test-metrics-*.json]"