Skip to content

test(cli): stop the root OIDC test calling the live schema server - #1985

Merged
paralta merged 9 commits into
agntcy:mainfrom
conorbronsdon:test/root-test-network
Aug 21, 2026
Merged

paralta merged 9 commits into
agntcy:mainfrom
conorbronsdon:test/root-test-network

Conversation

@conorbronsdon

@conorbronsdon conorbronsdon commented Aug 6, 2026 •

Copy link
Copy Markdown
Member

Follow-up to #1953, from the review thread there: 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 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_URL opt-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 the schema_response_valid.json fixture #1953 adds; they're inlined here because that fixture isn't on main until #1953 merges and go:embed can'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); with OASF_SCHEMA_URL=https://schema.oasf.outshift.com the case passes against the live service.

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]>
@github-actions github-actions Bot added the size/XS Denotes a PR that changes 0-49 lines label Aug 6, 2026
…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]>
@muscariello

Copy link
Copy Markdown
Member

Hey @conorbronsdon are you aware that we have a discord channel ?
It would be useful if you could join there.

@conorbronsdon

Copy link
Copy Markdown
Member Author

Hey @conorbronsdon are you aware that we have a discord channel ?
It would be useful if you could join there.

Happy to join

@codecov

codecov Bot commented Aug 12, 2026

Copy link
Copy Markdown

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
conorbronsdon marked this pull request as ready for review August 20, 2026 18:42
@conorbronsdon
conorbronsdon requested a review from a team as a code owner August 20, 2026 18:42

@lgecse lgecse left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@paralta
paralta merged commit ccaec72 into agntcy:main Aug 21, 2026
32 checks passed
@conorbronsdon
conorbronsdon deleted the test/root-test-network branch August 21, 2026 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/XS Denotes a PR that changes 0-49 lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants