Skip to content
Snippets Groups Projects
Commit 9c06e52a authored by Graeme Gillies's avatar Graeme Gillies
Browse files

feat: Add `gitlab-qa` as an easy way to run QA against a GitLab environment

Part of https://gitlab.com/gitlab-com/gl-infra/delivery/-/issues/2825

This change adds a GitLab CI snippet and documentation that allows
the running of GitLab QA against any GitLab instance.
parent f6c15897
No related branches found
No related tags found
No related merge requests found
Pipeline #21125310 passed
# [`gitlab-qa`](./gitlab-qa.yml)
Runs the [GitLab QA Orchestrator](https://gitlab.com/gitlab-org/gitlab-qa) in a specified configuration,
depending on inputs to the include.
## Setup process:
1. Ensure that your GitLab instance you wish to QA is available from the runner running your jobs
1. Make sure you know of the root password to the GitLab instance (if it's not the default)
1. Determine the QA image (that contains the test code) you wish to use for this environment. You typically want a version of the test code that matches the version of GitLab
that is running in the environment. Some example QA images are
* `registry.gitlab.com/gitlab-org/gitlab/gitlab-ee-qa:16.7.3-ee`
* `registry.gitlab.com/gitlab-org/gitlab/gitlab-ee-qa:16-7-stable-ee`
* `registry.gitlab.com/gitlab-org/gitlab/gitlab-ee-qa:f7d7a15ad657694bfc7ac7b02538c648822401c7`
These images are typically built using the `build-qa-image` job in the [gitlab-org/gitlab](https://gitlab.com/gitlab-org/gitlab) project.
1. Add the following to your `.gitlab-ci.yml`
```yaml
stages:
- gitlab-qa
include:
# Runs gitlab-qa on an environment
# see https://gitlab.com/gitlab-com/gl-infra/common-ci-tasks/-/blob/main/gitlab-qa.md
- project: 'gitlab-com/gl-infra/common-ci-tasks'
ref: v2.1.2 # renovate:managed
file: gitlab-qa.yml
inputs:
gitlab_initial_root_password: 'mypassword'
gitlab_url: 'https://mygitlab.example.com'
qa_image: 'registry.gitlab.com/gitlab-org/gitlab/gitlab-ee-qa:16.7.3-ee'
```
spec:
inputs:
stage:
default: gitlab-qa
gitlab_initial_root_password:
default: "5iveL!fe"
gitlab_url:
signup_disabled:
default: 'false'
qa_image:
qa_test_suite:
default: "Test::Instance::Any"
timeout:
default: "4h"
---
include:
- project: 'gitlab-org/quality/pipeline-common'
ref: master
file: ci/base.gitlab-ci.yml
gitlab-qa:
stage: $[[ inputs.stage ]]
extends:
- .qa-base
timeout: $[[ inputs.timeout ]]
variables:
QA_SCENARIO: $[[ inputs.qa_test_suite ]]
RELEASE: $[[ inputs.qa_image | expand_vars ]]
GITLAB_QA_OPTS: --address $[[ inputs.gitlab_url ]]
GITLAB_INITIAL_ROOT_PASSWORD: $[[ inputs.gitlab_initial_root_password | expand_vars ]]
SIGNUP_DISABLED: $[[ inputs.signup_disabled ]]
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment