Before you begin
Create a project API key under Settings → API keys, and store it as a secret namedEMPIRICALRUN_KEY in your CI provider. Every method on this page uses it.
GitHub Actions
With GitHub Actions, add the dispatch action after your deploy step:v1 receives backwards-compatible fixes, and breaking changes ship as a new major version. To pin
an exact release, use a tag such as v1.0.0.
Use the environment-variables input to set environment variables for the test
run, one per line in NAME: value format. These override the environment’s
configured variables. The URL of the build under test is passed to tests as the
BUILD_URL environment variable.
Set group and on-conflict in the concurrency input to control what happens
when the group already has an active run. For preview deployments, a group such
as preview/acme/web@${{ github.head_ref }} with cancel lets a new push
supersede the previous run for that branch. For production, use an
environment/repository group with wait to prevent deployments from testing
concurrently. See Concurrency.
Vercel deployments
For Vercel deployments, trigger tests on thedeployment_status event. You can
copy this workflow into .github/workflows/trigger-e2e.yaml:
GITHUB_TOKEN environment variable lets the action pull branch info for
the deployment, which is attached to the test run report.
Other providers
With any other CI/CD provider, trigger a run with the Trigger a test run API.Minimal snippet
Metadata for reporting
Add build details and metadata to show them on the run report:build: the repository, commit and branch that triggered the runmetadata: any other key-value pairsenvironment_variables_overrides: variables for this run, such asBUILD_URL
Pull request runs
For a pre-merge run on an application pull request, sendtrigger with the pull request. The
run uses the matching test branch, merged into the default branch. See
Branching.
trigger automatically on pull_request workflow events.
Concurrency
Tell Empirical what to do when a run for the same thing is already going. Runs that share aconcurrency.group (within the project) execute one at a time; on_conflict is what the
new run does when the group is busy. See Concurrency.
"on_conflict": "wait" to queue behind it instead, or the deployment URL as the group when
one server can only take one run at a time.
Reporters
Choose which reporters a run posts to withreporters. Leave it out to use the environment’s
reporters. This posts the GitHub check and PR comment for a pull request build, but no Slack
message:
{ reporter_type: "slack_run_status", slack_channels: ["C0123456789"] } to also post to a
Slack channel. Use the List reporters API to
find your channel ids and the repositories the GitHub Reporter covers. See
Report notifications.