debian-mirror-gitlab/.gitlab/ci/qa.gitlab-ci.yml
2023-03-05 14:24:40 +05:30

114 lines
3.1 KiB
YAML

.qa-job-base:
image: ${REGISTRY_HOST}/${REGISTRY_GROUP}/gitlab-build-images/debian-bullseye-ruby-${RUBY_VERSION}:bundler-2.3-chrome-${CHROME_VERSION}-docker-${DOCKER_VERSION}
extends:
- .default-retry
- .qa-cache
stage: test
needs: []
variables:
USE_BUNDLE_INSTALL: "false"
SETUP_DB: "false"
before_script:
- !reference [.default-before_script, before_script]
- cd qa && bundle install
qa:internal:
extends:
- .qa-job-base
- .qa:rules:internal
script:
- bundle exec rspec -O .rspec_internal
qa:internal-as-if-foss:
extends:
- qa:internal
- .qa:rules:internal-as-if-foss
- .as-if-foss
qa:selectors:
extends:
- .qa-job-base
- .qa:rules:ee-and-foss
script:
- bundle exec bin/qa Test::Sanity::Selectors
qa:master-auto-quarantine-dequarantine:
extends:
- .qa-job-base
rules:
- if: '$QA_TRIGGER_AUTO_QUARANTINE =~ /true|yes|1/i'
script:
- bundle exec confiner -r .confiner/master.yml
allow_failure: true
qa:nightly-auto-quarantine-dequarantine:
extends:
- .qa-job-base
rules:
- if: '$QA_TRIGGER_AUTO_QUARANTINE =~ /true|yes|1/i'
script:
- bundle exec confiner -r .confiner/nightly.yml
allow_failure: true
qa:selectors-as-if-foss:
extends:
- qa:selectors
- .qa:rules:as-if-foss
- .as-if-foss
qa:update-qa-cache:
extends:
- .qa-job-base
- .qa-cache-push
- .shared:rules:update-cache
stage: prepare
script:
- echo "Cache has been updated and ready to be uploaded."
e2e:package-and-test:
extends:
- .qa:rules:package-and-test
stage: qa
needs:
- build-assets-image
- build-qa-image
- e2e-test-pipeline-generate
variables:
# This is needed by `trigger-omnibus-env` (`.gitlab/ci/package-and-test/main.gitlab-ci.yml`).
PARENT_PIPELINE_ID: $CI_PIPELINE_ID
SKIP_MESSAGE: Skipping package-and-test due to mr containing only quarantine changes!
RELEASE: "${REGISTRY_HOST}/${REGISTRY_GROUP}/build/omnibus-gitlab-mirror/gitlab-ee:${CI_COMMIT_SHA}"
GITLAB_QA_IMAGE: "${CI_REGISTRY_IMAGE}/gitlab-ee-qa:${CI_COMMIT_SHA}"
RUN_WITH_BUNDLE: "true" # instructs pipeline to install and run gitlab-qa gem via bundler
QA_PATH: qa # sets the optional path for bundler to run from
trigger:
strategy: depend
forward:
yaml_variables: true
pipeline_variables: true
include:
- artifact: package-and-test-pipeline.yml
job: e2e-test-pipeline-generate
# Fetch child pipeline test results and store in parent pipeline
# workaround until natively implemented: https://gitlab.com/groups/gitlab-org/-/epics/8205
e2e:package-and-test-results:
image: ${REGISTRY_HOST}/${REGISTRY_GROUP}/gitlab-build-images/debian-bullseye-ruby-${RUBY_VERSION}:bundler-2.3
extends:
- .qa-job-base
- .qa:rules:package-and-test
stage: qa
needs:
- e2e:package-and-test
variables:
COLORIZED_LOGS: "true"
QA_LOG_LEVEL: "debug"
when: always
allow_failure: true
script:
- bundle exec rake "ci:download_test_results[e2e:package-and-test,e2e-test-report,${CI_PROJECT_DIR}]"
artifacts:
when: always
reports:
junit: gitlab-qa-run-*/**/rspec-*.xml