Repository navigation
test: add public health liveness contract test - #376
Merged
ashrafee-dev merged 1 commit intoNov 13, 2026
Merged
Conversation
|
@ananyamk1 is attempting to deploy a commit to the ashrafee-dev's projects Team on Vercel. A member of the Team first needs to authorize it. |
Owner
|
Thanks for your contributions! @ananyamk1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Outcome
Fixes #34
Adds a focused contract test for the public
/healthliveness endpoint: it's called with no Authorization header, returns 200 with exactly{"status": "ok"}, and never touches Redis or the provider. Before this, the only/healthtest (tests/test_security.py:52) sent the fixture's Bearer header and checked just the status code.Changes
tests/roadmap/text/test_health_contract.pywith one test,test_health_is_public_and_cheap:Authorizationheader (as AGENTS.md says to for unauthenticated tests)rate_limit.check_rate_limit,rate_limit.r.ping,risk.ask_deepseekandanalyze.get_assessmentwhere they're looked up{"status": "ok"}, and none of the four mocks were calledconftest.pyor existing tests, no new dependencies.Verification
Run on macOS, Python 3.13.9, uv, base
mainc05a0ec.Before (main): the only
/healthassertion is the status code.After:
The test catches a broken contract. I temporarily changed
health_check()to return{"status": "broken"}(reverted after, not part of this PR):Full checks (
scripts/check.sh):The warning is the existing
StarletteDeprecationWarningfromfastapi/testclient.py, also onmain.Not verified: I didn't run the docs build (no docs changed), the container smoke test, or anything on Linux/Windows.
Review notes
risk.pyandanalyze.pyimport them, so the "not called" assertions would actually catch a call through those modules.