fix: authenticate the live-Concord bridge test (issue #120)#121
Merged
Conversation
… user The `@pytest.mark.concord` test `test_bridge_live_against_concord` builds its httpx client by hand and overrode only `get_concord_client` and `get_db`. Since Slice 8 added auth (`get_current_user`) to the annotation and read endpoints, its unauthenticated POST to `/api/v1/annotations` returned 401 instead of 201, failing the `Run pytest -m concord` CI job (issue #120). Add a `get_current_user` override resolving the seeded default user (id=1), mirroring the `client_for` fixture the fast bridge tests already use. Test-only change; no product code touched. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
What landed
Fixes the failing
Run pytest -m concordCI job (#120).test_bridge_live_against_concord(the@pytest.mark.concordend-to-end test) builds its httpx client by hand and overrode onlyget_concord_clientandget_db. Since Slice 8 added authentication (get_current_user) to the annotation and read endpoints, its POST to/api/v1/annotationsran the real auth path with no session cookie and returned 401, so the test asserted201 == 401and failed. The two fast bridge tests in the same file pass because they use theclient_forfixture, which already overridesget_current_user.The fix adds a
get_current_userdependency override to the live test that resolves the seeded default user (id=1) — exactly whatclient_fordoes. This is a stale-test fix; no product code changes, single file touched (backend/tests/bridge_test.py).The created annotation gets
author_id=1and the overlay filters to author 1, identical to the fast bridge tests, so the canonical-coordinate bridge assertions (verse-16 overlay in both KJV and WEB) hold.How it was verified
pytest -m "not concord"— 241 passed (full fast suite).0 errors).Run pytest -m concordjob — which has one — to confirm green.🤖 Generated with Claude Code