Skip to content

fix: authenticate the live-Concord bridge test (issue #120)#121

Merged
kbennett2000 merged 1 commit into
mainfrom
slice/120-fix-concord-ci
Jul 8, 2026
Merged

fix: authenticate the live-Concord bridge test (issue #120)#121
kbennett2000 merged 1 commit into
mainfrom
slice/120-fix-concord-ci

Conversation

@kbennett2000

Copy link
Copy Markdown
Owner

What landed

Fixes the failing Run pytest -m concord CI job (#120).

test_bridge_live_against_concord (the @pytest.mark.concord end-to-end test) builds its httpx client by hand and overrode only get_concord_client and get_db. Since Slice 8 added authentication (get_current_user) to the annotation and read endpoints, its POST to /api/v1/annotations ran the real auth path with no session cookie and returned 401, so the test asserted 201 == 401 and failed. The two fast bridge tests in the same file pass because they use the client_for fixture, which already overrides get_current_user.

The fix adds a get_current_user dependency override to the live test that resolves the seeded default user (id=1) — exactly what client_for does. This is a stale-test fix; no product code changes, single file touched (backend/tests/bridge_test.py).

The created annotation gets author_id=1 and 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).
  • Ruff clean; Pyright-strict clean over the configured scope (0 errors).
  • The concord-marked test itself needs a live Concord (none available locally), so it relies on the CI Run pytest -m concord job — which has one — to confirm green.

🤖 Generated with Claude Code

… 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>
@kbennett2000
kbennett2000 merged commit 83e747b into main Jul 8, 2026
2 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