Skip to content
SlashClone

Production smoke test

@slashclone/production-smoke-test

Write a short smoke test script for a live site: the status endpoint, the home page, search, sign-in redirects, and any connected services, each retried while a new deploy settles. Exits non-zero on the first failure so a release can roll back.

SkillDevOpsv0.1.0 (latest)
Activity
New: be the first to try it
  1. 1---
  2. 2name: production-smoke-test
  3. 3description: Write a production smoke test script that a release pipeline runs after each deploy. Use when someone wants to know a deploy worked before users find out it did not.
  4. 4---
  5. 5
  6. 6# Production smoke test
  7. 7
  8. 8A smoke test answers one question after a deploy: is the site up and doing its main jobs? It is not a test suite. Five to ten checks, under three minutes, read-only.
  9. 9
  10. 10## What to check
  11. 12Pick the checks that match the app. Good defaults:
  12. 141. **Status endpoint:** returns OK and reports each dependency (database, storage, other services) as up. Add one if the app has none.
  13. 152. **Home page:** HTTP 200.
  14. 163. **The main read path:** a search or list endpoint returns at least one result for a query that always has results.
  15. 174. **Sign-in:** each provider's start URL redirects to the provider with the production callback URL (catches a wrong base URL or missing env var). Never sign in.
  16. 185. **Connected services:** each health endpoint answers, and protected endpoints refuse a request with no credentials (401), so auth was not switched off.
  17. 20## How to write it
  18. 22- Bash with `set -uo pipefail`, `curl` with `--max-time`, and a `retry` helper that tries each check for about two minutes while a new deploy settles.
  19. 23- Base URLs from environment variables with production defaults, so it can run against staging too.
  20. 24- Print `ok: name` or `FAILED: name` per check, run them all, and exit non-zero if any failed.
  21. 25- No credentials, no writes, no personal data in requests.
  22. 27## After writing
  23. 29Run it once against production and show the output. Then wire it into the release workflow after the deploy step, with rollback on failure.