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
- Installs
- 0 installs
- Likes
- 0 likes
- Clones
- 0 clones
- 1---
- 2name: production-smoke-test
- 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---
- 6# Production smoke test
- 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.
- 10## What to check
- 12Pick the checks that match the app. Good defaults:
- 141. **Status endpoint:** returns OK and reports each dependency (database, storage, other services) as up. Add one if the app has none.
- 152. **Home page:** HTTP 200.
- 163. **The main read path:** a search or list endpoint returns at least one result for a query that always has results.
- 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.
- 185. **Connected services:** each health endpoint answers, and protected endpoints refuse a request with no credentials (401), so auth was not switched off.
- 20## How to write it
- 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.
- 23- Base URLs from environment variables with production defaults, so it can run against staging too.
- 24- Print `ok: name` or `FAILED: name` per check, run them all, and exit non-zero if any failed.
- 25- No credentials, no writes, no personal data in requests.
- 27## After writing
- 29Run it once against production and show the output. Then wire it into the release workflow after the deploy step, with rollback on failure.
