Source: https://everyrole.dev/blog/run-tests-after-deploy

# Run tests after every deploy, not every night

Post-deployment testing: the deploy starts the tests on the live address, and the result names that deploy. The set-up, and what a nightly run is still for.

Nov 22, 2026  5 min read  by the EveryRole team

Post-deployment testing is simple to describe: the last step of every deploy starts your tests against the live address, and the result carries the name of that deploy. If sign-up broke, you know within minutes, and you know which change did it.

A nightly run finds the same bug. It finds it tomorrow, after a day of visitors met it, and it can’t tell you which of the day’s deploys to blame.

![Two timelines of the same broken deploy. With a nightly run: it breaks in the morning, more deploys go out, the run fails at night, someone reads it the next morning. With a run after every deploy: the run fails minutes later naming the deploy, and it is fixed the same morning](https://everyrole.dev/s/blog/run-tests-after-deploy/timeline.webp)

The bug is the same. What changes is how long it lives, and whether the alert says where to look.

## What a nightly run costs you

Two things, and the second is the bigger one.

The first is time. A bug shipped in the morning is live until someone reads the night’s report. For a blog that is fine. For a sign-up form it is a day of people leaving.

The second is the name. A team that ships several times a day gets a nightly alert that says “the editor can no longer create an item” and nothing about why. Somebody has to walk back through the day’s merges to find the one. With a run per deploy, the alert arrives with a commit attached, and the person who wrote it has the change fresh in their head.

Nightly runs were designed for nightly builds. If you deploy on every merge, the test rhythm should match the deploy rhythm.

## Post-deployment testing: how to run tests after deploy

Whatever runs your tests needs one thing from the pipeline: a signal, at the very end, that says “a new version is live”. The usual shape is a deploy hook, a private address your pipeline calls:

```
curl -X POST "$TEST_HOOK_URL" \
  -H "Content-Type: application/json" \
  -d "{\"commit\": \"$COMMIT_SHA\", \"ref\": \"$BRANCH\"}"
```

Four details decide whether this works in practice.

**Send the commit.** The hook should carry what was deployed, so the result can show it. An alert without it is a nightly alert that arrives sooner.

**Call it after the deploy is live, not after the build.** If your host swaps versions a little after the pipeline says “done”, the tests run against the old version and pass. Wait for the new version to answer first. A version number in a page footer or a health address makes this easy to check.

**Keep the hook’s address secret.** Anyone who has it can start runs. Store it with your pipeline’s other secrets.

**Don’t stack runs.** If two deploys land within a few minutes, you don’t want two runs queueing, the first testing a version that is already gone. One waiting run, testing the newest deploy, is the right behaviour.

## What to run: more than a smoke test after deployment

The common advice is to run a smoke test after a deploy: is the site up, does the home page load. Do that, but don’t stop there. “The page loads” was true of every broken sign-up form we have seen. We compared the levels in [smoke vs sanity vs regression testing](https://everyrole.dev/blog/smoke-vs-sanity-vs-regression-testing).

Run the journeys that cost you when they break: sign up, log in, the main thing your app does, the walk to the payment step. Each with a real result at the end, as each kind of user.

Then keep it short, by one rule: the person who deployed should still be looking when the result arrives. Whatever doesn’t fit goes into a second part that runs right after, in the background. That is where journeys that [wait on slow work](https://everyrole.dev/blog/slow-e2e-tests) belong (a report being generated, a video being made), and the link checks, and the long tail of extra cases.

[On production, the run has to be safe](https://everyrole.dev/blog/testing-in-production). No test presses Pay or Delete. The checkout walk [stops at the payment step](https://everyrole.dev/blog/test-checkout-without-paying). Anything a test creates is [cleaned up](https://everyrole.dev/blog/test-data-cleanup), or the test is kept for previews. Most of your data-changing tests should already have passed there, on [the preview deployment](https://everyrole.dev/blog/e2e-tests-preview-deployments), before the merge.

## When it fails

Decide this before the first failure, because the first failure will arrive at a bad moment.

- **Who hears.** The person who deployed, first. A channel everyone has muted is no one.
- **What they do.** Roll back, then investigate. The run after the rollback tells you whether it worked.
- **When it’s over.** An alert when a journey breaks and one when it works again. Without the second, people keep checking by hand.
- **What isn’t an alarm.** If the test runner itself fell over (its browser crashed, the network dropped), that is “couldn’t check”, and it should not wake anyone. A run that cries wolf gets ignored. The same goes for a test that fails and passes on the same version: treat it as [flaky](https://everyrole.dev/blog/flaky-tests) and fix the test, loudly marked, without calling the deploy broken.

## Keep the schedule too

Some things break with no deploy at all. A certificate or an API key expires. A service you depend on changes its answer. A table grows until a page times out. A scheduled job fills a disk.

A run on a schedule catches those. Once a day is enough for a small app, at an hour when someone will see the result soon after. So the answer to “after every deploy or every night” is both, with different jobs: the deploy run tells you what you broke, the scheduled run tells you what broke by itself.

## How EveryRole runs after a deploy

Each app in EveryRole can have a deploy hook: a secret link that starts a run of its tests. Your pipeline calls it when a deploy finishes. The commit, branch and link you send are shown with the run, so a result names the deploy it tested. If two deploys arrive while a run is still waiting, there is one run, and it tests the newest. The [deploy hook docs](https://everyrole.dev/docs#deploy-hooks) have a snippet for the common pipelines.

After a deploy, a run has two parts. The check comes first: the quick tests and the page checks. Tests that EveryRole has measured as long, the ones that wait on your app’s own slow work, run right after in the background as a second part of the same run, so they never hold back the next deploy’s check.

The schedule sits beside it.

![EveryRole's "On a schedule" setting: "Catches what breaks without a deploy. You hear about it only if something changed", with a switch for every day at a chosen hour and time zone](https://everyrole.dev/s/blog/run-tests-after-deploy/on-a-schedule.webp)

The daily run in an app’s settings. Its job is what breaks without a deploy.

You get an alert when a test breaks and again when it works. A problem on our side is shown as Couldn’t check and never alerts you.

## Try it on your own app

EveryRole tests your app’s real user journeys for each kind of user, from the live site, and runs them after every deploy. Paste your app’s address to see what it finds.

[Start with your app](https://everyrole.dev/signup) [How it works](https://everyrole.dev/docs#start)

## Keep reading

Deploys and CI

### [Run E2E tests on every preview deployment](https://everyrole.dev/blog/e2e-tests-preview-deployments)

To run E2E tests on preview deployments, wait for the deploy, take its address and run your journeys there. Five traps, and what a preview can’t prove.

Nov 22, 2026  6 min read

Deploys and CI

### [Slow E2E tests? Split the journey at the wait](https://everyrole.dev/blog/slow-e2e-tests)

Slow E2E tests have three causes. Two are fixed inside the test. The third is your app’s own slow work, and the answer is to split the journey at the wait.

Nov 22, 2026  6 min read

Deploys and CI

### [Testing in production, safely](https://everyrole.dev/blog/testing-in-production)

Testing in production is safe under six rules: test accounts, never-click words, named test data, clean-up, no retry after a real send, a stop before money.

Nov 22, 2026  6 min read
