Authentication

All of the methods below use API key to authenticate. Generate a new API key from the dashboard.

GitHub Actions

Use our dispatch-action if you are using GitHub Actions for CI/CD.

- name: Deploy step
  id: deploy-step
  run: ...

- name: Dispatch for tests
  uses: empirical-run/dispatch-action@main
  with:
    auth-key: ${{ secrets.EMPIRICALRUN_KEY }}
    build-url: ${{ steps.deploy-step.outputs.url }}
    environment: production

Other providers

For other CI/CD providers, you can trigger a test run with an API call.

Minimal snippet

curl -X POST \
  https://dispatch.empirical.run/v1/trigger \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $EMPIRICALRUN_KEY" \
  -d '{ "environment": "production" }'

Metadata for reporting

You can add more metadata which will associated to the test run reports.

  • Repo where the trigger was sent from
  • Details of the commit or branch
  • Other metadata (key-value pairs)
curl -X POST \
  https://dispatch.empirical.run/v1/trigger \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $EMPIRICALRUN_KEY" \
  -d '{
    "environment": "production",
    "origin": {
      "owner": "$GITHUB_ORG",
      "name": "$GITHUB_REPO"
    },
    "build": {
      "url": "$BUILD_URL",
      "commit": "$COMMIT",
      "branch": "$BRANCH",
      "commit_url": "$COMMIT_URL"
    },
    "metadata": {
      "pairs": "of",
      "key": "value"
    }
  }'