Repository navigation
Consolidate overlapping test cases to recover test budget - #1821
Conversation
Architecture-Review: unchanged; this test-only change preserves the delivery and trust behavior. Co-Authored-By: Codex <noreply@openai.com>
There was a problem hiding this comment.
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.
| ], | ||
| ], | ||
| ) | ||
| MINIMAL = '[repo]\nname = "o/n"\n' |
There was a problem hiding this comment.
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.
|
|
||
| from loopzero import worktree | ||
| from tests.conftest import commit_file, git, git_environment, init_git_repo | ||
| from tests.test_setup import SETUP, setup_commands |
There was a problem hiding this comment.
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.
| commit_file(clone, name, name, name) | ||
| git(clone, "push", "-q", "origin", "main") | ||
| return git(clone, "rev-parse", "HEAD").strip() | ||
| return worktree.head(clone) |
There was a problem hiding this comment.
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().
| ("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"), |
There was a problem hiding this comment.
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.
|
@Mergifyio queue |
✅ Merged into
|
|
No description provided. |
Consolidate overlapping test cases to recover test budget
Context and goal
0538de69. The replacement keeps Preserve carriage returns in Git paths #1805's carriage-return checkout and its retry assertions.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
d56deee84dffuv run --group dev ruff check src tests: exit 0uv run --group dev tach check: exit 0uv run --python 3.14 python scripts/check_architecture_docs.py: exit 0scripts/size_budget.sh: exit 0uv run --group dev pytest -q: exit 0Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.Review