Skip to content

feat: add post-deployment smoke test - #42

Merged
davidgut1982 merged 2 commits into
mainfrom
feat/smoke-test
Jun 2, 2026
Merged

feat: add post-deployment smoke test#42
davidgut1982 merged 2 commits into
mainfrom
feat/smoke-test

Conversation

@davidgut1982

Copy link
Copy Markdown
Owner

Summary

  • scripts/smoke_test.py: standalone post-deployment smoke test (stdlib + httpx only, no pytest) that exercises the critical KB write/read/delete path against a live instance and exits 0 on full pass, 1 on any failure
  • Makefile: three new targets — smoke, smoke-staging, smoke-prod — with a LORE_URL override variable
  • CONTRIBUTING.md: new Deployment Verification section, release process step 8 covering per-node smoke runs, note in PR checklist that smoke tests are for live deployments not CI, updated Makefile reference table

What the smoke test does

Five steps in sequence against a live instance:

Step Tool What it verifies
1 GET /health Server process is up
2 kb_add DB connection + write path
3 kb_search FTS indexing + search path
4 kb_get Direct lookup by ID, content round-trip
5 kb_get_batch Batch-get endpoint wired correctly

Cleanup (kb_delete) runs best-effort after every run — never causes a FAIL.

Output uses ANSI green/red PASS/FAIL lines. Exits 0 on full pass, 1 on any failure.

Usage

# Generic
python scripts/smoke_test.py --url http://localhost:5555

# Via make
make smoke LORE_URL=http://192.168.1.21:5555
make smoke-staging   # CT 200, port 5556
make smoke-prod      # CT 121, port 5555

Design notes

  • Mirrors tests/e2e/client.py (LoreClient) exactly — same SSE-framing unwrap, same MCP TextContent envelope unwrap, same Lore ok/data business envelope unwrap — so it uses the same wire protocol as the e2e suite
  • Only deps: httpx (already in pyproject.toml as a core dependency) and stdlib
  • Not a pytest file — runs standalone with python scripts/smoke_test.py
  • --token arg supports Bearer auth for instances that require it

Test plan

  • python scripts/smoke_test.py --url http://localhost:5555 against a running instance: all steps PASS, exit 0
  • Kill the server, re-run: step 1 FAIL, exit 1
  • make smoke LORE_URL=http://localhost:5555: runs correctly via make
  • python scripts/smoke_test.py --help: shows usage

🤖 Generated with Claude Code

- scripts/smoke_test.py: standalone script (httpx + stdlib only) that
  exercises kb_add → kb_search → kb_get → kb_get_batch → kb_delete in
  sequence against a live instance, with colored PASS/FAIL output and
  proper exit codes
- Makefile: smoke, smoke-staging, smoke-prod targets
- CONTRIBUTING.md: deployment verification step in release process and
  note in PR/testing section that smoke tests are for live deployments
The parameter `inner` is typed as `dict[str, Any]`, so the
`not isinstance(inner, dict)` branch is always False and line 166
(`return inner`) is unreachable — flagged by Pyright/mypy
warn_unreachable. Remove the dead guard; the function still handles
all runtime cases correctly.
@davidgut1982
davidgut1982 merged commit 63085f4 into main Jun 2, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant