Smoke Test Runner
Overview
Execute fast, high-confidence smoke tests that validate critical application functionality after deployment or build. Smoke tests verify that the application starts, core user flows work, and key integrations respond -- without running the full test suite.
Prerequisites
- Application deployed and accessible at a known URL or running locally
- HTTP client available (
curl, wget, node-fetch, or Playwright)
- List of critical endpoints and user flows to validate
- Expected response codes and content patterns for each check
- CI/CD pipeline hook for post-deployment validation
Instructions
- Identify the critical paths that constitute a "working" application:
- Health check endpoint returns 200 with expected body.
- Homepage loads and contains key UI elements.
- Authentication flow succeeds with test credentials.
- Primary API endpoint returns valid data.
- Database connection is active and responding.
- Create a smoke test configuration listing each check:
- URL or command to execute.
- Expected HTTP status code (200, 301, etc.).
- Response body pattern to match (substring or regex).
- Maximum acceptable response time (e.g., 3 seconds).
- Write the smoke test suite as a lightweight script or test file:
- Use
curl for HTTP checks or Playwright for browser-based checks.
- Run checks sequentially for simplicity (parallel for speed if independent).
- Fail fast on the first critical failure.
- Log each check result with pass/fail, response time, and status code.
- Implement timeout guards:
- Set a global timeout of 60 seconds for the entire smoke suite.
- Set per-check timeouts of 5-10 seconds.
- Treat timeouts as failures, not retries.
- Add deployment-gate integration:
- On success: proceed with deployment promotion or traffic shifting.
- On failure: trigger rollback and send alert notification.
- Report results to CI/CD dashboard and Slack/Teams webhook.
- Store smoke test results as CI artifacts for audit trail.
- Schedule periodic smoke runs (every 5 minutes in production) as synthetic monitoring.
Output
- Smoke test script (
scripts/smoke-test.sh or tests/smoke.test.ts)
- Pass/fail result for each critical check with response times
- Deployment gate verdict (PASS or FAIL with reason)
- CI artifact with timestamped smoke test log
- Alert payload for failed checks (Slack webhook, PagerDuty, etc.)
Error Handling
| Error |
Cause |
Solution |
| Connection refused |
Application not yet ready after deployment |
Add a startup wait with exponential backoff (max 30 seconds) before running smoke tests |
| 503 Service Unavailable |
Application is starting or behind a load balancer draining |
Retry with 2-second delay up to 3 times; check load balancer health check status |
| Unexpected redirect (301/302) |
URL changed or SSL redirect not accounted for |
Follow redirects with curl -L; update expected URLs in smoke config |
| Content mismatch |
Page content changed but smoke test pattern is too specific |
Use broad patterns (check for <title> or key element IDs, not exact text) |
| Timeout on database check |
Database migration running or connection pool exhausted |
Increase timeout for database checks; verify migration completed before smoke tests |
Examples
Shell-based smoke test script:
#!/bin/bash
set -e
BASE_URL="${1:-http://localhost:3000}" # 3000: 3 seconds in ms
PASS=0; FAIL=0
check() {
local name="$1" url="$2" expected="$3"
status=$(curl -s -o /dev/null -w '%{http_code}' --max-time 5 "$url")
if [ "$status" = "$expected" ]; then
echo "PASS: $name (HTTP $status)"
((PASS++))
else
echo "FAIL: $name (expected $expected, got $status)"
((FAIL++))
fi
}
check "Health check" "$BASE_URL/health" "200" # HTTP 200 OK
check "Homepage" "$BASE_URL/" "200" # HTTP 200 OK
check "API status" "$BASE_URL/api/status" "200" # HTTP 200 OK
check "Login page" "$BASE_URL/login" "200" # HTTP 200 OK
echo "Results: $PASS passed, $FAIL failed"
[ "$FAIL" -eq 0 ] || exit 1
Playwright smoke test:
import { test, expect } from '@playwright/test';
test('homepage loads with navigation', async ({ page }) => {
await page.goto('/', { timeout: 10000 }); # 10000: 10 seconds in ms
await expect(page.locator('nav')).toBeVisible();
await expect(page).toHaveTitle(/My App/);
});
test('API health endpoint responds', async ({ request }) => {
const response = await request.get('/api/health');
expect(response.ok()).toBeTruthy();
expect(await response.json()).toHaveProperty('status', 'ok');
});
Resources
Converted and distributed by TomeVault — claim your Tome and manage your conversions.
1---2name: jeremylongshore-claude-code-plugins-plus-skills-running-smok3description: Smoke Test Runner4---5# Smoke Test Runner67## Overview89Execute fast, high-confidence smoke tests that validate critical application functionality after deployment or build. Smoke tests verify that the application starts, core user flows work, and key integrations respond -- without running the full test suite.1011## Prerequisites1213- Application deployed and accessible at a known URL or running locally14- HTTP client available (`curl`, `wget`, `node-fetch`, or Playwright)15- List of critical endpoints and user flows to validate16- Expected response codes and content patterns for each check17- CI/CD pipeline hook for post-deployment validation1819## Instructions20211. Identify the critical paths that constitute a "working" application:22 - Health check endpoint returns 200 with expected body.23 - Homepage loads and contains key UI elements.24 - Authentication flow succeeds with test credentials.25 - Primary API endpoint returns valid data.26 - Database connection is active and responding.272. Create a smoke test configuration listing each check:28 - URL or command to execute.29 - Expected HTTP status code (200, 301, etc.).30 - Response body pattern to match (substring or regex).31 - Maximum acceptable response time (e.g., 3 seconds).323. Write the smoke test suite as a lightweight script or test file:33 - Use `curl` for HTTP checks or Playwright for browser-based checks.34 - Run checks sequentially for simplicity (parallel for speed if independent).35 - Fail fast on the first critical failure.36 - Log each check result with pass/fail, response time, and status code.374. Implement timeout guards:38 - Set a global timeout of 60 seconds for the entire smoke suite.39 - Set per-check timeouts of 5-10 seconds.40 - Treat timeouts as failures, not retries.415. Add deployment-gate integration:42 - On success: proceed with deployment promotion or traffic shifting.43 - On failure: trigger rollback and send alert notification.44 - Report results to CI/CD dashboard and Slack/Teams webhook.456. Store smoke test results as CI artifacts for audit trail.467. Schedule periodic smoke runs (every 5 minutes in production) as synthetic monitoring.4748## Output4950- Smoke test script (`scripts/smoke-test.sh` or `tests/smoke.test.ts`)51- Pass/fail result for each critical check with response times52- Deployment gate verdict (PASS or FAIL with reason)53- CI artifact with timestamped smoke test log54- Alert payload for failed checks (Slack webhook, PagerDuty, etc.)5556## Error Handling5758| Error | Cause | Solution |59|-------|-------|---------|60| Connection refused | Application not yet ready after deployment | Add a startup wait with exponential backoff (max 30 seconds) before running smoke tests |61| 503 Service Unavailable | Application is starting or behind a load balancer draining | Retry with 2-second delay up to 3 times; check load balancer health check status |62| Unexpected redirect (301/302) | URL changed or SSL redirect not accounted for | Follow redirects with `curl -L`; update expected URLs in smoke config |63| Content mismatch | Page content changed but smoke test pattern is too specific | Use broad patterns (check for `<title>` or key element IDs, not exact text) |64| Timeout on database check | Database migration running or connection pool exhausted | Increase timeout for database checks; verify migration completed before smoke tests |6566## Examples6768**Shell-based smoke test script:**69```bash70#!/bin/bash71set -e72BASE_URL="${1:-http://localhost:3000}" # 3000: 3 seconds in ms73PASS=0; FAIL=07475check() {76 local name="$1" url="$2" expected="$3"77 status=$(curl -s -o /dev/null -w '%{http_code}' --max-time 5 "$url")78 if [ "$status" = "$expected" ]; then79 echo "PASS: $name (HTTP $status)"80 ((PASS++))81 else82 echo "FAIL: $name (expected $expected, got $status)"83 ((FAIL++))84 fi85}8687check "Health check" "$BASE_URL/health" "200" # HTTP 200 OK88check "Homepage" "$BASE_URL/" "200" # HTTP 200 OK89check "API status" "$BASE_URL/api/status" "200" # HTTP 200 OK90check "Login page" "$BASE_URL/login" "200" # HTTP 200 OK9192echo "Results: $PASS passed, $FAIL failed"93[ "$FAIL" -eq 0 ] || exit 194```9596**Playwright smoke test:**97```typescript98import { test, expect } from '@playwright/test';99100test('homepage loads with navigation', async ({ page }) => {101 await page.goto('/', { timeout: 10000 }); # 10000: 10 seconds in ms102 await expect(page.locator('nav')).toBeVisible();103 await expect(page).toHaveTitle(/My App/);104});105106test('API health endpoint responds', async ({ request }) => {107 const response = await request.get('/api/health');108 expect(response.ok()).toBeTruthy();109 expect(await response.json()).toHaveProperty('status', 'ok');110});111```112113## Resources114115- Smoke testing methodology: https://martinfowler.com/bliki/SmokeTest.html116- Playwright API testing: https://playwright.dev/docs/api-testing117- curl documentation: https://curl.se/docs/manpage.html118- GitHub Actions deployment gates: https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment119120---121> Converted and distributed by [TomeVault](https://tomevault.io/claim/jeremylongshore) — claim your Tome and manage your conversions.122<!-- tomevault:4.0:skill_md:2026-04-11 -->