Skip to content

GitLab CI/CD Setup

You'll need
  • a GitLab project with a test runner reporter already configured (see Getting Started)
  • the project is built with GitLab CI/CD on gitlab.com
  • your Flakiness.io project linked to that GitLab project
You'll have
  • CI uploading reports to Flakiness.io on every push and merge request, using a short-lived token exchanged via GitLab OIDC.

On GitLab CI/CD, reporters can authenticate via GitLab OIDC, so there are no secrets to create, rotate, or leak.

  1. Confirm the reporter has flakinessProject set. OIDC requires the project identifier so Flakiness.io knows where to route the upload. If you followed Getting Started, this is already done.

  2. Declare an ID token named FLAKINESS_ID_TOKEN. Its aud must be your Flakiness.io project identifier.

    .gitlab-ci.yml
    test:
    stage: test
    id_tokens:
    FLAKINESS_ID_TOKEN:
    aud: my-org/my-app
    script:
    - npx playwright test
  3. Push. The reporter picks up the ID token automatically at upload time.

On success you’ll see a confirmation line in the test output:

[flakiness.io] ✓ Uploaded as https://flakiness.io/my-org/my-app/run/42

Flakiness.io verifies ID tokens against https://gitlab.com. Pipelines on a self-managed instance cannot authenticate this way and should use an access token instead.