Skip to content

fix(test): accept endpoint kwarg in local-appdata trust test stub (#5879) - #5887

Closed
CrysisDeu wants to merge 1 commit into
mainfrom
fix/usage-test-stub-kwargs-5879
Closed

fix(test): accept endpoint kwarg in local-appdata trust test stub (#5879)#5887
CrysisDeu wants to merge 1 commit into
mainfrom
fix/usage-test-stub-kwargs-5879

Conversation

@CrysisDeu

Copy link
Copy Markdown
Collaborator

Summary

Main unblocker: one-line test fix. TestWindowsCliStore::test_local_appdata_store_token_is_trusted_without_arn fails on all backend shards of main's own CI (and on every PR merge ref) with assert None is not None.

Closes #5879

Root cause

PR #4545 changed _post in src/kiro_crew/dashboard/handlers/kiro_usage_api.py to take a keyword-only parameter:

def _post(token: str, target: str, payload: dict, *, endpoint: str | None = None) -> _Resp:

Both production call sites (:598, :901) now pass endpoint=. The failing test's stub at test/test_kiro_usage_api.py:505 was declared def fake_post(token, target, payload) without **_kwargs, so the side_effect raises TypeError inside fetch_usage_limits, which degrades to returning None — hence the assertion failure.

Fix

Add **_kwargs to the stub's signature, byte-matching the passing sibling stub at :466. Grep confirms every other _post stub in the file (fake_post × 7, recording_post × 3) already accepts **_kwargs; line 505 was the only miss.

Deliberately minimal diff (1 line): this unblocks PR Readiness repo-wide. The Frontend Tests shard 3 red on main is a separate issue (#5529) and is not touched here.

Verification

  • Red→green proven locally on main head 6ed29f5cb: the test fails before the change (assert None is not None) and passes after; full test/test_kiro_usage_api.py = 88 passed.
  • Local gates: isort / flake8 / mypy clean; black diff-gate passed; full pytest = 68281 passed, 15 failures all in files untouched by this diff (host-env classes: test_xdist_host_budget, test_artifact_source, test_host_isolation_floor, test_trust_reads — byte-identical to main).
  • Pre-push model-pinned reviews: GPT lane (gpt-5.6-sol) PASS, zero findings. Opus lane (claude-opus-5) PASS, zero blocking; one advisory noted below.

Advisory disposition

Opus advisory: the stub swallows endpoint into **_kwargs, so the test cannot observe whether the regional endpoint is threaded to _TARGET_GET_USAGE. Capturing and asserting it is real coverage of #4545's behavior but widens the diff beyond a one-line main unblocker — deferred, not adopted here.

@github-actions

Copy link
Copy Markdown
Contributor

Design Review (Fable 5) — ✅ PASS

Design-level review of 169347f5d3501802e94ecea23167a1545392defc — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

The diff is a one-line test stub fix, exactly as described: line 505's fake_post was the sole stub missing **_kwargs, and the change aligns it with every sibling in the file. The description matches the diff bidirectionally, the fix addresses the actual root cause (stub signature drift after #4545's keyword-only parameter), and the deferred coverage advisory is a reasonable scoping call for a CI unblocker.

Design-Verdict: PASS

One-line stub-signature fix that unblocks CI at its root cause; minimal, correct scope, no design surface touched.

[DESIGN-REVIEWED] 169347f

@github-actions

Copy link
Copy Markdown
Contributor

GPT 5.6 Review — ✅ no blocking findings

GPT 5.6 completed its review of 169347f5d3501802e94ecea23167a1545392defc and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 169347f

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 169347f5d3501802e94ecea23167a1545392defc: <one-sentence reason>

@github-actions

Copy link
Copy Markdown
Contributor

Opus 4.8 Review — ✅ no blocking findings

Reviewed 169347f5d3501802e94ecea23167a1545392defc — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 169347f

Verdict parsed from the review's SHA-scoped output markers for commit 169347f5d3501802e94ecea23167a1545392defc.

False positive or not applicable? A repository writer can comment:
/ai-review override fable 169347f5d3501802e94ecea23167a1545392defc: <one-sentence reason>

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Aug 25, 2026
@CrysisDeu

Copy link
Copy Markdown
Collaborator Author

Status: review-ready — the 5 red checks are inherited from main, not this PR's.

Evidence for the maintainer:

  • The 5 reds are Backend Tests (Windows) (4), (3.10, 4), (3.12, 4)Coverage GatePR Readiness. Each shard-4 job fails on exactly one test: test/test_trust_reads.py::TestIsReadOnlyBash::test_a_word_bash_deletes_cannot_forge_a_read_mode (AssertionError: wc -l < f) — issue main red: #5521 raw-scan refuses all input redirects, contradicting #5541 pinned redirect-read allowance #5846, red on main itself, zero overlap with this PR's one-line diff in test/test_kiro_usage_api.py.
  • The shard-2 jobs (where the test this PR fixes lives) are all green on this PR's merge ref, proving the fix works.
  • Everything this PR owns is green (58/63), MERGEABLE, and all AI review lanes settled PASS on head 169347f5d (Design PASS, GPT no blocking findings, Opus no blocking findings).

Cross-deadlock note: #5880 fixes #5846 (trust_reads) and inherits this PR's usage-api red on its shard-2 jobs; this PR inherits #5880's trust_reads red on shard-4. Neither can reach a fully green board until one of them merges — merging either one first (with its known inherited red), then rebasing the other, greens both and un-blocks PR Readiness repo-wide.

@bolichen97

Copy link
Copy Markdown
Collaborator

Full-diff overlap audit (current head 169347f5d3501802e94ecea23167a1545392defc): this PR's entire diff is the one-line test/test_kiro_usage_api.py change from fake_post(token, target, payload) to fake_post(token, target, payload, **_kwargs). Merged #3410 (ff15bbe14c6e45f1e1c9b218106cf77a49b5e6ad) carries the byte-identical hunk. The path-filtered stable patch-id is identical (b53e2b53b67cdb0cb3c45c87a5953a507351fb41), and the resulting file blob already matches main.

Closing as exactly covered by merged #3410.

@bolichen97 bolichen97 closed this Aug 29, 2026
@github-actions github-actions Bot removed the readiness: action required A blocking check or review needs attention label Aug 29, 2026
@bolichen97
bolichen97 deleted the fix/usage-test-stub-kwargs-5879 branch September 6, 2026 03:57
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.

main red: TestWindowsCliStore.test_local_appdata_store_token_is_trusted_without_arn fails on all backend shards

2 participants