Skip to content

Configuring Environments

You'll need
You'll have
  • staging and production histories visible and switchable in the dashboard’s environment picker.

Set environment variables prefixed with FK_ENV_ before running tests. The reporter strips the prefix, lowercases the key, and attaches the rest as environment metadata.

Terminal window
export FK_ENV_DEPLOYMENT=staging
export FK_ENV_REGION=us-east-1

Results in environment metadata:

{
"deployment": "staging",
"region": "us-east-1"
}

Runs with deployment=staging land in a separate history from runs with deployment=production.

The example below uses GitHub Actions and Playwright Test. The general pattern applies to any CI/runner.

.github/workflows/tests.yml
jobs:
test:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
strategy:
matrix:
deployment: [staging, production]
env:
FK_ENV_DEPLOYMENT: ${{ matrix.deployment }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
- run: npm ci
- run: npx playwright test

Push to the repo. On the project dashboard, open the environment picker (top-right) and select staging or production — each has its own commit history, flakiness stats, and PR checks.

Flakiness.io’s official reporters auto-collect some metadata so you don’t have to set it manually:

  • Operating system — captured by every official reporter.
  • Runner-specific detail — e.g. @flakiness/playwright can capture browser version when enabled.

Use FK_ENV_* for everything else: deployment target, database backend, region, feature flag, etc.