Performance problems are cheapest to fix in the pull request that caused them. Running a short load test in CI turns "the site got slow last month" into "this change made checkout 40% slower", with the commit attached.

What to run in CI, and what not to

A CI load test is not your big capacity test. Keep it:

  • Short: one to three minutes, so it does not slow every merge.
  • Steady: a fixed, moderate arrival rate, the same every time, so runs are comparable.
  • Focused: the few journeys that matter most (login, search, checkout).
  • Strict about regressions, not absolute numbers: fail when the p95 is much worse than the baseline, not when it misses a perfect target.

Run the long capacity and soak tests on a schedule instead, for example every night against staging.

Where to point it

The best target is the pull request's own preview deployment, if your platform creates one. Otherwise, test staging after each merge to the main branch. Never point automated tests at production without limits you are sure of.

A GitHub Actions example

With Hoofbeat, create an API token under Settings → API tokens, store it as the repository secret HOOFBEAT_TOKEN, and add a step:

# .github/workflows/load-test.yml
name: Load test
on:
    pull_request:

jobs:
    load-test:
        runs-on: ubuntu-latest
        steps:
            - uses: elvinaqalarov99/hoofbeat-action@v1
              with:
                  url: https://hoofbeat.dev
                  token: ${{ secrets.HOOFBEAT_TOKEN }}
                  flow: <your flow id>

The step fails when the run's thresholds fail, so the pull request shows a red check with a link to the run; cancelling the job stops the run. Add base-url to test the pull request's preview deployment instead of the flow's target. Outside GitHub, the hoofbeat CLI does the same: it exits 0 when the run passed and 1 when it failed.

Make the results trustworthy

  • Warm up the target before measuring, or ignore the first 30 seconds; cold caches make every run look like a regression.
  • Use the same load every time. Changing the test and the code at once makes comparison meaningless.
  • Keep test data stable. Seed the same accounts and products for each run.
  • Watch for noisy neighbours. If results swing between identical runs, test from a dedicated load generator rather than a shared CI runner.

Start small

Add one flow with one threshold (p95 of the most important step) and let it run for a week. Once the team trusts the signal, add more journeys and stricter goals.