Add ability to route e2e tests to a cell
What does this MR do and why?
Adds the ability to run the E2E tests against a different cell.
Allows a _gitlab_session cookie to be passed in using QA_COOKIES, if this cookie is passed in requests will be sent to the associated cell.
If _gitlab_session=cell-2-please is set, this will direct traffic to cell-2, the server will then set a valid _gitlab_session cookie which will be used for subsequent tests.
-
Follow-up: small docs change in gitlab-qa: gitlab-qa!1433 (merged)
References
- How many E2E tests work today on the 2nd cell ? (gitlab-com/gl-infra/tenant-scale/cells-infrastructure/team#342 - closed)
- Add support for targeting a cell in Smoke test ... (gitlab-org/quality/test-governance/request-for-help#15 - closed)
How to set up and validate locally
Testing against staging (regression)
QA_COOKIES= GITLAB_USERNAME=gitlab-qa GITLAB_PASSWORD=1P QA_LOG_LEVEL=debug GITLAB_QA_USER_AGENT=1P GITLAB_QA_ACCESS_TOKEN=1P QA_GITLAB_URL=https://staging.gitlab.com bundle exec rspec qa/specs/features/browser_ui/10_software_supply_chain_security/login/log_in_spec.rb
Expected: Test pass / observe no Next icon
Testing against staging-canary (regression)
QA_COOKIES=gitlab_canary=true GITLAB_USERNAME=gitlab-qa GITLAB_PASSWORD=1P QA_LOG_LEVEL=debug GITLAB_QA_USER_AGENT=1P GITLAB_QA_ACCESS_TOKEN=1P QA_GITLAB_URL=https://staging.gitlab.com bundle exec rspec qa/specs/features/browser_ui/10_software_supply_chain_security/login/log_in_spec.rb
Expected: Test pass / observe Next icon
Testing against a second cell in staging (this change)
Staging is running a second cell so it can only be verified in staging.
GITLAB_QA_ADMIN_ACCESS_TOKEN=1P GITLAB_ACCESS_TOKEN=1P QA_COOKIES=_gitlab_session=cell-2-please GITLAB_PASSWORD=1P GITLAB_USERNAME=cell-2-gitlab-qa QA_LOG_LEVEL=debug GITLAB_QA_USER_AGENT=1P QA_GITLAB_URL=https://staging.gitlab.com bundle exec rspec qa/specs/features/browser_ui/10_software_supply_chain_security/login/log_in_spec.rb
cell-2 staging credentials are in 1Password under cell-2-gitlab-qa
Expected: If running against cell-2 in staging, an orange banner will be displayed:

MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.