Skip to content

fix(test): implement JsonClient.authorization on TestCampusRequest (sdk #119 drift) - #975

Merged
ngjunsiang merged 1 commit into
weeklyfrom
fix/harness-sdk-authorization
Oct 27, 2026
Merged

ngjunsiang merged 1 commit into
weeklyfrom
fix/harness-sdk-authorization

Conversation

@nycomp

@nycomp nycomp commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

Refs #971 (second incident of the same disease). Unblocks the phase-1 stack (#970) whose CI gates on contract.

Problem

With a current campus_python build (sdk #119, 91d674b — "expose JsonClient.authorization"), every contract-suite service fixture fails at setup:

TypeError: Can't instantiate abstract class TestCampusRequest with abstract method authorization

patch_campus_python swaps CampusRequest for TestCampusRequest throughout the cross-service test harness; the sdk added an abstract authorization property to the JsonClient ABC, and the test double never implemented it. This is currently red on weekly itself in any venv with the current sdk — the stale locally-built sdk in older venvs had masked the drift in both directions (see #971).

Fix

TestCampusRequest implements the property, mirroring production semantics: peek the value of the Authorization header that would be sent (override headers if set, else env-derived), None when unset. No state change, no behavior change for existing tests.

Verification

tests.contract.api.test_api_circles (the failing class) green on this branch alone; full unit (842), contract, integration, and ruff check . green at the tip of the stacked series.

sdk #119 (91d674b) added an abstract authorization property to
campus_python's JsonClient ABC, breaking every contract-suite service
fixture: patch_campus_python swaps CampusRequest for TestCampusRequest,
which did not implement the new member ('Can't instantiate abstract
class TestCampusRequest with abstract method authorization'). The stale
locally-built sdk in existing venvs had masked the drift (#971).

The test double now mirrors the production peek: return the value of
the Authorization header that would be sent, without mutating state.
@nycomp
nycomp force-pushed the fix/harness-sdk-authorization branch from a4cfd75 to 4a0e201 Compare October 27, 2026 15:51
@ngjunsiang
ngjunsiang merged commit 5909847 into weekly Oct 27, 2026
22 checks passed
@nycomp
nycomp deleted the fix/harness-sdk-authorization branch October 27, 2026 16:00
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.

2 participants