Repository navigation
test(bundle): record the fake GitHub API's unmatched requests and assert on them outside the application - #569
Open
hivecommons-hive[bot] wants to merge 1 commit into
Open
hivecommons-hive[bot] wants to merge 1 commit into
hivecommons-hive[bot] wants to merge 1 commit into
Conversation
…ert on them outside the application The bundle fake answered every request no route matched with a 404 and left each scenario to notice: a forgotten route for tide's merge queue read was swallowed by queueState into a warning and a direct merge, so the scenario passed on traffic it never modelled. fakeGithub.ts now keeps the unmatched requests apart (unmatched), takes explicit allowances for the probes a scenario relies on missing (allowUnmatched), and fails a scenario on the rest (unexpectedRequests, assertNoUnexpectedRequests). The configuration loader's reads are always allowed: every run without a routed prow configuration makes them. fakeGithubUnexpected.test.ts pins that contract with plain fetches. ownersParseArms.test.ts and ownersProbeArms.test.ts adopt it: the merge queue read is answered "no queue" through mergeQueueFallback as the lgtm arms already do, the OWNERS probes each scenario expects to miss are allowed in that scenario, and anything else unrouted fails it. Signed-off-by: quality <280983584+hivecommons-hive[bot]@users.noreply.github.com>
4 tasks
Contributor
Author
|
Important Held for human review by the hive's ACMM level gate. This PR was opened by the "quality" agent while Hive policy required a human checkpoint for that agent. Agent PRs are held at ACMM L3–L5; an Hive will keep the |
Contributor
Author
|
/kind cleanup 🐝 Hive Agent: — hive: agent=quality backend=copilot model=claude-fable-5.1 |
This was referenced Oct 22, 2026
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.
Test Improvement
Files/functions claimed:
__tests__/bundle/fakeGithub.ts(FakeGithub.unmatched,allowUnmatched,unexpectedRequests,assertNoUnexpectedRequests,reset), new__tests__/bundle/fakeGithubUnexpected.test.ts, and thebeforeEach/afterEachof__tests__/bundle/ownersParseArms.test.tsand__tests__/bundle/ownersProbeArms.test.ts. Cluster: #554 P1 harness item "record unexpected API traffic and assert on it outside application error handling".unmatched, takes explicit allowances for the misses a scenario relies on (allowUnmatched(method, pattern)), andassertNoUnexpectedRequests()throws naming the rest. The configuration loader's probes are always allowed: every run without a routed prow configuration makes them.fakeGithubUnexpected.test.tspins that contract with plain fetches (6 tests): unrouted → 404 + unexpected; routed/fallback → neither; loader probes allowed, an explicitly sourced config read is not; allowances by exact path, pattern and method;resetclears both the record and the scenario's allowances.ownersParseArmsandownersProbeArmsadopt it: tide's merge queue read is answered "no queue" throughmergeQueueFallback(aslgtmBindingArms/lgtmRemovalNoopArmsalready do) instead of a 404 thatqueueStateswallows into a warning; the OWNERS probes each scenario expects to miss (sdk%2FOWNERS, rootOWNERSon master, master's tree) are allowed in that scenario; anything else unrouted fails it. Before the allowances were added the assertion flagged exactly those probes in 10 tests, which is the mechanism working.Measured on main at e3119ad: 3,029 unmatched requests across the bundle suite, 25 of them an unrouted
POST /graphql. Wider adoption is left out on purpose: the blunderbuss files are occupied by #559/#561/#562/#567, and #568 lists the remaining files.Verified locally at 6faa951:
vitest run __tests__/bundle→ 87 files, 534 tests pass;eslintclean on the four files.git merge-treeagainst #555's head (the only open PR touchingfakeGithub.ts) merges cleanly.Related Issue
Closes #568
Refs #554 (umbrella tracker; this lands its second P1 harness checkbox, the mutation-check and assertion-policy boxes and the other sections stay open)
Filed by quality agent (hold-gated mode). Human review required.
— hive: agent=quality backend=copilot model=claude-fable-5.1 requested_by=@mrbobbytables