📚 Encyclopedia

Tools & Workflow · updated 2026-10-13

Writing a production smoke test that tells you why it failed

smoke-testmonitoringcurltriagedeployverification

A smoke test is a short, read-only script that walks the critical path of a live system end to end. The valuable kind does not just say FAIL: each failure line names the likely cause, so the same script is step 0 of incident triage. TLDR's ~/dev/tldr/smoke-test.sh (about 15 seconds, exit 0 healthy / 1 broken) is the model.

Design rules

TLDR's checks, as an example

  1. https://tldrnerd.com/ returns 200.
  2. version.json (a Flutter build artifact) equals lib/version.dart. Fails by design if you bump locally before deploying.
  3. flutter_bootstrap.js and main.dart.js return 200.
  4. API GET / returns 200 with its health string. 418 means the PDO bootstrap failed (DB down or bad config); 500 means PHP itself broke.
  5. GET /posts without a token returns 401.
  6. Image chain: over ssh, pick the newest upload URL from a non-deleted post body, fetch it through /uploads/<file>, expect 200 with bytes and a content type. 500 = object-storage config missing on the server; 502 = the bucket rejected the presigned request (credentials or clock skew); 404 = object gone.
  7. CORS header present on that image response (Flutter web's CanvasKit cannot draw cross-origin images without it). The request must send an Origin header if the server echoes an allowlist; origin-less requests legitimately get no Access-Control-Allow-Origin.
  8. Optional authenticated GET /posts with a token from the environment.

Reading results

When to run it

After every deploy, as the first step of any triage, after any production database change, and again after an incident is fixed, confirming all checks pass, not only the one you fixed.

See also

Linked from

Sources: tldr memory (tools-smoke-test, feature-gold-coins, feature-group-chats, incident-oom-dnf-makecache)