Skip to content

Consolidate overlapping test cases to recover test budget - #1821

Merged
mergify[bot] merged 1 commit into
mainfrom
lean178/575-test-headroom-r53
Nov 26, 2026
Merged

mergify[bot] merged 1 commit into
mainfrom
lean178/575-test-headroom-r53

Conversation

@eowca

@eowca eowca commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Consolidate overlapping test cases to recover test budget

Context and goal

Refs #575

Acceptance

Evidence

The resolved patch removes 154 net test lines. Retained tests detected eight isolated spot mutations covering architecture acknowledgment, config defaults, missing-review status, merged streams, completed-order selection, empty-key rejection, runner fallback, and uncommitted diff content. The focused worktree test also passed with #1805's carriage-return path.

Base

Base: 40fab65

Validation

Recorded for d56deee84dff

  • uv run --group dev ruff check src tests: exit 0
  • uv run --group dev tach check: exit 0
  • uv run --python 3.14 python scripts/check_architecture_docs.py: exit 0
  • scripts/size_budget.sh: exit 0
  • uv run --group dev pytest -q: exit 0

Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

Review

  • primary, claude, d56deee, approve

Architecture-Review: unchanged; this test-only change preserves the delivery and trust behavior.
Co-Authored-By: Codex <noreply@openai.com>

@loopzero-feder-positronics loopzero-feder-positronics Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

loopzero primary review by claude on d56deee84dff731a5a0a3a39c566ca3d48f3c311, 76.8s: approve (0 critical, 0 important, 4 suggestion)

Settings per native call (launch configuration and CLI claims, not backend attestation):

  • Call 1: requested model claude-opus-5-5 (effort medium); CLI-reported model claude-opus-5-5 (effort unknown); configured model claude-opus-5-5 (effort medium)

Native Claude output is retained in the restricted local review receipt.

Comment thread tests/test_config.py
],
],
)
MINIMAL = '[repo]\nname = "o/n"\n'

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

suggestion: MINIMAL is defined twice in the same module

MINIMAL = '[repo]\nname = "o/n"\n' appears at line 10 and again at line 68 with the same value. Ruff's F811 check only flags redefined functions and imports, so lint won't catch this. If someone later edits one copy, the tests that use the other copy will quietly use a different fixture. Fix: delete the second definition at line 68.

Comment thread tests/test_worktree.py

from loopzero import worktree
from tests.conftest import commit_file, git, git_environment, init_git_repo
from tests.test_setup import SETUP, setup_commands

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

suggestion: test_worktree now imports helpers from another test module

from tests.test_setup import SETUP, setup_commands makes test_worktree depend on a test module. Renaming or restructuring test_setup.py would now break test_worktree as well. The shared code is a small doc-snippet extractor, so it belongs in tests/conftest.py or a small tests/_docs.py helper, where other test files that parse SETUP.md can also use it.

Comment thread tests/test_worktree.py
commit_file(clone, name, name, name)
git(clone, "push", "-q", "origin", "main")
return git(clone, "rev-parse", "HEAD").strip()
return worktree.head(clone)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

suggestion: Fixture helper now uses the function under test to compute its expected value

commit_on_origin used to return git rev-parse HEAD and now returns worktree.head(clone). Its result is later used as expected text in the moved-base error assertion. If worktree.head regressed, the helper and the code under test would be wrong in the same way, so that assertion would be checking the code against itself. This saves no lines. Fix: switch back to the independent git(clone, "rev-parse", "HEAD").strip().

Comment thread tests/test_hosted.py
("valid", None, ""), ("policy", hosted.LoopZeroError, "no review recorded"),
("hold", hosted.LoopZeroError, "source #101: PR #101 has a merge-authority hold"),
("merged", CandidateError, "not open"),
("race", CandidateRaceError, "metadata changed"),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

suggestion: The 'merged' candidate case is gone; only the publisher-raises variant is left

The removed ("merged", CandidateError, "not open") case covered a source PR closing after the pending status, followed by a normal failure publication. The remaining publisher case goes down the same path, but its failure publish raises. So no test now checks the plain path where the failure status is published successfully and the CandidateError still propagates. published records the attempt before the raise, so most of this is still covered. If coverage parity matters, make the publisher raise depend on a flag instead of keeping a second case.

@eowca
eowca marked this pull request as ready for review November 26, 2026 11:01
@eowca

eowca commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

@Mergifyio queue

@mergify

mergify Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

✅ Merged into main as f6d2cb9 at 11:06 UTC

5 min in the queue, 4 min of it CI.

So far

  • ✅ Entered the queue Thu 26 Nov, 11:01 · rule main · triggered by @eowca with the @mergifyio queue command
  • ✅ Passed · draft #1827
  • ✅ Merged 11:06 · f6d2cb9 · squash
3 merge conditions met
  • github-review-approved · required by GitHub repository ruleset rule main: PR only, Mergify queue, existing checks required
  • any of · required by GitHub repository ruleset rule main: PR only, Mergify queue, existing checks required:
    • check-success = checks
    • check-neutral = checks
    • check-skipped = checks
  • any of · required by GitHub repository ruleset rule main: PR only, Mergify queue, existing checks required:
    • check-success = Loop-zero Eligibility
    • check-neutral = Loop-zero Eligibility
    • check-skipped = Loop-zero Eligibility

Times in UTC · dashboard · how the merge queue works

@eowca

eowca commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

No description provided.

@mergify
mergify Bot merged commit f6d2cb9 into main Nov 26, 2026
18 checks passed
@eowca
eowca deleted the lean178/575-test-headroom-r53 branch November 26, 2026 11:07
@mergify mergify Bot removed the queued label Nov 26, 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.

1 participant