Skip to content

test(metrics): run the off-offer tests on a stand-in default home - #37547

Closed
chenmingwei23 wants to merge 1 commit into
mainfrom
fix/kiro-export-offoffer-tests
Closed

chenmingwei23 wants to merge 1 commit into
mainfrom
fix/kiro-export-offoffer-tests

Conversation

@chenmingwei23

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: TestOffOffer runs on a stand-in default data home again, so its three red tests on main pass while still proving a non-default home is not asked.

Three TestOffOffer tests are red on main (87b11b5ef2). Two PRs crossed. #37460 removed the home fixture's is_default_home() -> True patch, because destinations() no longer checks the home. #37463, merged after it, added its own is_default_home() check to off_offer_due(): the offer is asked on the default home only. The test's private home is not the default one, so the offer is never due there.

Why it matters

Main is red on every backend run that collects this file, so every open PR inherits three failures it did not cause.

Not a goal

What changed (motivation → approach → change)

The offer tests need the default home; the rest of the file needs the real one. So TestOffOffer gets a class-local autouse fixture that patches beacon.is_default_home to True. Its existing home case still patches it back to False and asserts the offer is not due.

Backwards compatibility

Test-only change. No product code changes.

Tests

test/metrics/test_kiro_export_destination.py::TestOffOffer: 19 passed (the 3 that were red included), serial.

Manual verification

Not applicable: test-only change.

Screenshots / video

Not applicable: no UI change.

Related Issues

Fixes #37546

Related: #37460, #37463

Sibling sweep

The other classes in this file run on the real non-default home on purpose (#37460's test_a_non_default_home_gets_it) and are left as they are.

Pattern harvest

  • Pattern: a fixture-wide patch removed by one PR while another PR adds a check that relied on it. Scope such a patch to the class whose behaviour needs it.

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Nov 15, 2026
@github-actions

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ⏭️ skipped

Revision 64851cd9cbe13d02250e691e37c9329701c43531 ships no reviewable capability (docs, tests or generated files only), so there is nothing to inventory. Does not block merge.

@github-actions

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ⏭️ skipped

Revision 64851cd9cbe13d02250e691e37c9329701c43531 touches no user-facing surface (no changes under website/ or committed screenshots), so the UX review was skipped. Does not block merge.

@github-actions

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of 64851cd9cbe13d02250e691e37c9329701c43531 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

Design-Verdict: PASS

Nothing blocks: this is a test-only fix scoped to the one class whose behaviour needs the default home.

[DESIGN-REVIEWED] 64851cd

Description read

[DESCRIPTION-READ] 44f03979a8afc7228f4d806d108933e8da47d1811baf49fee416e5b955b0e90f

That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed 64851cd9cbe13d02250e691e37c9329701c43531 — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 64851cd

Verdict parsed from the review's SHA-scoped output markers for commit 64851cd9cbe13d02250e691e37c9329701c43531.

False positive or not applicable? A repository writer can comment:
/ai-review override fable 64851cd9cbe13d02250e691e37c9329701c43531 false-positive: <reason, 20 to 500 characters>

@github-actions

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — 🔴 changes requested (blocking)

GPT 6.1 found at least one blocking issue that must be resolved before merging 64851cd9cbe13d02250e691e37c9329701c43531. Adjudication upheld 1 of 1 blocking finding(s); those must be resolved before merging.

This comment is updated in place on each push.

BLOCKING -- test/metrics/test_kiro_export_destination.py:394 -- Use the independent patch stack for the autouse fixture

def _default_home(self, monkeypatch):
Trigger: Every TestOffOffer case runs this autouse fixture using the same monkeypatch instance as the home fixture and test-owned overrides.
Outcome: The autouse baseline belongs to the test’s undo stack rather than the independently owned fixture stack, violating the explicit D11 prohibition in tests-are-deterministic item 12.
Anchor: tests-are-deterministic
Fix: Request _floor_monkeypatch and use it for this fixture’s setattr; retain shared monkeypatch for per-case overrides.

[BLOCK-MERGE] 64851cd
[GPT-REVIEWED] 64851cd

Adjudication (Opus 5.5) — is blocking on each finding proportionate?

F1: the rule is blocking, and this is a newly added autouse fixture that uses the shared monkeypatch. tests-are-deterministic has blocking: true at .review-base-rules/AUTOSDE.yaml:371. Its item 12 (D11), at .review-base-rules/AUTOSDE.yaml:457-459, bans exactly this case.
test/metrics/test_kiro_export_destination.py:393-396 adds an autouse _default_home(self, monkeypatch) in commit 64851cd. The _floor_monkeypatch fixture it should use exists at conftest.py:156. The rule outranks any weighing, so there is no proportionality call to make.

[ADJUDICATION] 64851cd total=1 uphold=1 downgrade=0
UPHOLD F1 test/metrics/test_kiro_export_destination.py:394 reason=autosde-blocking-rule
[GPT-ADJUDICATED] 64851cd

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 64851cd9cbe13d02250e691e37c9329701c43531 false-positive: <reason, 20 to 500 characters>

@chenmingwei23

Copy link
Copy Markdown
Contributor Author

Duplicate of #37545 (same TestOffOffer fix, opened two minutes earlier). Closing this one; #37545 carries the fix.

@github-actions github-actions Bot removed the readiness: checking Automated validation is still running label Nov 15, 2026
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: TestOffOffer runs on a non-default home after #37460 and #37463 crossed

1 participant