Skip to main content

The tests pass. Can users open the page?

· 10 min read
Marvin Zhang
Software Engineer & Open Source Enthusiast

The tests pass. You ship the release. A user opens the app and gets an error page. The service may even be reporting that it’s healthy while you try to figure out why the page won’t load.

When an AI coding agent writes a feature and its tests together, a single assumption can shape both. Suppose the agent adds a jobs dashboard and assumes that fetching the jobs is enough to make the dashboard usable. It writes a test that gives the data-fetching code a sample response and checks the jobs it gets back. That test can keep passing if a packaging change makes the dashboard unreachable. The user still has to get through the web server, open the right route, and see the jobs on the page.

We hit that gap on Crawlab Pro. We now run a check against the same build we plan to ship, through the address users would open. The release waits for that check to pass.

What a green check tells you​

A unit test is a good place to check that a job list sorts correctly or that an empty result displays a helpful message. It gives you a quick, specific failure when the logic changes. The test can pass on its own while the version assembled by CI is missing a file or has a broken route. I went into that tradeoff in my piece on unit testing.

A health check has a different job. The platform uses it to decide whether a service is alive or ready to take traffic. Depending on what the probe checks, the backend can keep reporting healthy while a proxy in front of it serves the wrong page. A check against the built app goes through that proxy and looks for the result the user needs.

Unit tests exercise code in isolation. Health checks see whether the service is alive. User-facing checks exercise the built app through its real entry point and can stop a broken release.

You can keep all three and learn something from where the failure shows up. If the dashboard fails to load and the backend health check passes, you can start with the route, the proxy, or the startup configuration. If the dashboard loads but a job is missing, you can look at which data made it to the screen.

Put the check in the path to release​

A user-facing check starts with something you can observe. If people use an API, send a real request and check for the value their code depends on. If they use a browser, open the page and look for the thing they came to find. For a jobs dashboard, you could create a job with a known name, open the dashboard, and check that the name appears. That expectation can stay put when an agent changes how the dashboard fetches or renders its data. Stop Babysitting Your Agent

Start the candidate image or build in CI and use its real entry point with the services it needs. A staging address is fine if it’s serving that candidate and exercises the same route. Run the check there, then make the job that publishes the image or promotes it to stable depend on the result. A check in a separate job can report a failure while promotion goes ahead if CI has no dependency between them.

For a container release, point both jobs at the same image digest. If CI builds an image for the check and then builds another one for release, the second build can pick up different dependencies or packaging settings. The check answers whether the tested image works. Keeping that image through promotion means CI can apply the answer to what users receive.

CI runs checks against the built artifact’s real entry point. The release job can proceed on exit 0. A failed check exits 1, holds the release, and leaves an expected-versus-actual report for the releaser.

Here’s the front-door check from the Acme teaching demo. This excerpt is the body of one check in the YAML definition. It sends a real HTTP request and checks both the status and the title in the JSON response. Complete demo definition at v0.9.7

steps:
- id: front
uses: api/call
with: { method: GET, url: $inputs.front_url, timeout: 10s }
outputs: { status: status, body: body }
assertions:
- $steps.front.outputs.status == 200
- $steps.front.outputs.body.title == "Acme Dashboard"

In broken mode, the demo's Node server returns a healthy response from /health and HTTP 200 from /. The root response has the title Welcome to nginx!, so the status assertion passes and the title assertion fails. In fixed mode the root returns Acme Dashboard and both assertions pass. That’s why I’d check for an identifying value even on a page that already returns 200.

Cropped Duhem demo report showing the failed title check AC-2.1. Expected Acme Dashboard, but the actual title was Welcome to nginx!

Real Duhem report from the demo/self-masking teaching fixture. A small HTTP server simulates the user-visible effect of the empty-nginx failure while health stays green. The Crawlab incident itself returned 404.

To use that decision in CI, install the pinned CLI, validate your definition, and put this command in the job that promotion depends on. It writes the structured result to a file and leaves Duhem’s exit status intact.

duhem run .duhem/duhem.yml --no-live --reporter json > duhem-summary.json

An exit code of 0 lets the next job proceed. A nonzero exit holds the release, whether an assertion failed or the check couldn’t complete. Have CI keep the report even when the job fails and link the job from the release failure notification. The person releasing can open the result, see which assertion failed and compare expected with actual. A wrong page sends them toward the route or deployment config. A connection error sends them to check whether the candidate started and whether CI can reach it.

Keep the first check small enough to run on every candidate. If the page requires signing in, give the check a test account and a known record it can look for. That makes it easier to tell a missing row from a test environment with no data. A pass then tells you that this account could take this path and see that record. Other accounts and operations need checks of their own if they become release requirements.

What happened on Crawlab Pro​

In mid-July 2026, a Crawlab Pro :edge image was missing envsubst, the utility that fills in its nginx config template. A shell redirect emptied nginx.conf before the command ran, and the startup script ignored the error. The web interface stopped serving on the expected port. The backend kept writing its health-status file, so the container still reported healthy. July 17 incident write-up

The check we ran by hand visited the web entry point. Assertion AC-1::AC-1.1 expected HTTP 200 and got 404. With the existing health signal alone the image could have been promoted to :stable with a broken web page. The Duhem result gave us a reason to hold it before that happened. Crawlab account in the v0.9.7 README

In the mid-July Crawlab Pro incident, missing envsubst left nginx.conf empty while backend health stayed green. Without the gate the image could have reached stable with a 404. Duhem caught it, promotion stopped, the fix passed on rerun, and the gate moved into edge CI.

We installed envsubst and changed startup to render to a temporary file, then atomically replace the nginx config only after the render succeeded. The same check passed on the repaired candidate. After that, we made Duhem run automatically on every :edge build and required a pass for promotion to :stable. The public record is our first-party account of the stopped promotion and successful rerun. July 17 incident write-up

Try it on a build you ship​

Start with Duhem’s offline quickstart. Once the CLI is installed, you can see a pass and a failure on your machine without a network connection. For your own app, pick the first check you’d do by hand after deploying and put that check on the candidate build. Run it against a working build and a deliberately broken test candidate before making it a release dependency. If the broken candidate still goes through, fix the check or the CI dependency before relying on it. Duhem on GitHub · Getting-started guide

Technical details

To reproduce the dashboard capture, use Node.js 18+, Git, Bash, curl, and a free loopback port 8477. Install the pinned Duhem CLI with pnpm add -g duhem@0.9.7 or download the archive for your platform and verify it against SHA256SUMS.txt. The HTTP fixture runs without Chromium. Duhem v0.9.7 release

git clone --branch v0.9.7 --depth 1 https://github.com/onsager-ai/duhem.git duhem-0.9.7
cd duhem-0.9.7
duhem validate demo/self-masking
PORT=8477 DUHEM=duhem bash demo/self-masking/run.sh

Read the two verdicts in the output. The wrapper continues after the intentional failure, sets APP_FIXED=1 for the second run, and cleans up. Its final shell status reflects the wrapper. To change the port, update the two URL defaults in the YAML as well. Run script · URL inputs

For an unattended example, Duhem’s own pinned CI ran a reference program that printed ready and a deliberately wrong one that printed not ready. The same check passed the former and failed the latter. For your runs, keep the summary and evidence database alongside the candidate image digest, check version, and CI job URL. Those identify which release and which assertions a verdict covers. Crawlab’s public incident account contains the assertion output. The original run bundle and candidate digest are unavailable in that account. Public CI job · Report format