Repository navigation
test(cli): stop the root OIDC test calling the live schema server - #1985
Merged
Merged
Conversation
From the agntcy#1953 review thread: the validate case in TestLocalCommandsDoNotRequireOIDCToken still handed --url the live schema service, so the default cli/cmd unit run made a real network call on every run. It now defaults to a local httptest server replaying the recorded response, with OASF_SCHEMA_URL as the live opt-in, the same pattern as the validate package's tests. Signed-off-by: Conor Bronsdon <[email protected]>
The comment claimed test files cannot be imported across packages, which is true but not the operative constraint — the sibling line reads validate/testdata/record_valid.json across the same boundary. The real reasons are that agntcy#1953's response fixture is not on main yet and that go:embed cannot reference a parent directory. Signed-off-by: Conor Bronsdon <[email protected]>
Signed-off-by: Conor Bronsdon <[email protected]>
…prose as a directive A doc comment line wrapped to start with 'go:embed', which the linter parses as a malformed compiler directive (space after //). Reflowed so the phrase sits mid-line; no behavior change. Signed-off-by: Conor Bronsdon <[email protected]>
Member
|
Hey @conorbronsdon are you aware that we have a discord channel ? |
Member
Author
Happy to join |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Now that agntcy#1953 is on main, embed its recorded valid response directly instead of duplicating the JSON and retaining the pre-merge rationale. Signed-off-by: Conor Bronsdon <[email protected]>
conorbronsdon
marked this pull request as ready for review
August 20, 2026 18:42
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.
Follow-up to #1953, from the review thread there: the validate case in
TestLocalCommandsDoNotRequireOIDCTokenstill handed--urlthe live schema service, so the defaultcli/cmdunit run made a real network call on every run. It couldn't go red offline — the assertion only checks the error isn't the OIDC one — but the request was real.The fix reuses the
OASF_SCHEMA_URLopt-in convention #1953 introduces: set it to run against a live service, otherwise a local httptest server answers. Unlike the validate package's server this one is deliberately body-blind — the test asserts on the auth path, not validation semantics, so recorded-response dispatch would be machinery with no assertion behind it. The response bytes are byte-identical to theschema_response_valid.jsonfixture #1953 adds; they're inlined here because that fixture isn't on main until #1953 merges andgo:embedcan't reference a parent directory, which keeps this PR green in either merge order.Verified both ways: the default run passes offline with the request landing on the local server (
POST /api/0.8.0/validate/object/record?missing_recommended=true, confirmed via temporary instrumentation); withOASF_SCHEMA_URL=https://schema.oasf.outshift.comthe case passes against the live service.