You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
prove: do not select tests the change deletes - #4
Found while trying test-check on gitmoot (gitmoot#2261): tests the change deleted were still selected for per-test proving, then reported test_not_run. A test declaration on a removed line now clears the current test, so the deleted body is not attributed to any test; a rename still selects the new name. Regression test TestChangedTestNamesSkipsDeletedAndRenamedAwayTests fails on main ([TestKeep TestGone TestNewName]) and passes here.
Decision:approved Summary: Executed review of PR #4 at exact head 34499a1 (diff aa04331..34499a1: internal/prove/prove.go, internal/prove/review_fixes_test.go, skills/test-check/SKILL.md). The pair of commits is correct: (1) a removed test declaration now resets current to "" so changed lines below a -func TestX( / -def test_x( line are never attributed to the deleted test (prove.go:331-342); (2) the new union filter re-reads every changed test file from the working tree and keeps only names still declared (prove.go:350-370), which is the right catch-all for hunk headers, since git labels hunks with the OLD file's function — verified live: the second commit's own regression fixture produces @@ func TestGone( and the deleted name is dropped, in both Go and Python. Verified requester's checklist end to end in a scratch copy: pure renames select nothing (changedPaths uses --no-renames, so the old path is unreadable and contributes no declarations); rename+edit selects the edited test; deleted tests never reach names via hunk headers; a name that enters names ONLY via an old-file hunk header is still kept when declared in a different changed test file (union semantics — verified, a_test.go header names TestMoved, b_test.go declares it, result [TestKeep TestOther TestMoved]); untracked test files contribute all their tests (untracked files are in testFiles, so the declared-scan also keeps same-name filtered entries — the seen-map dedupe hazard I suspected is unreachable via Run's call path); a fully deleted test file selects nothing; edited tracked tests are still selected. End-to-end Run() check: a fix + test-deletion change proves only TestAtThree — no test_not_run for the deleted name (the gitmoot#2261 failure mode). Filter is safe: every legitimate name comes from a + decl (declared in new content by construction) or a context/hunk-header decl still present in the file; filtered names share the names[:0] backing array correctly (write index <= read
[truncated]
Tests Run
CGO_ENABLED=0 go vet ./... — clean
CGO_ENABLED=0 go build ./... — clean
CGO_ENABLED=0 go test ./... — all 5 packages ok (cmd/test-check 0.156s, check 0.004s, jev 0.006s, prove 2.522s, source 0.080s)
CGO_ENABLED=0 go test ./internal/prove/ -run ChangedTestNames -v — 3/3 PASS including new TestChangedTestNamesSkipsDeletedAndRenamedAwayTests and TestChangedTestNamesIgnoresDeletedTestNamedByHunkHeader
Scratch copy ($HOME/scratch/tc-review, workspace untouched): 8 added scratch tests all PASS — TestScratchRenameOnlySelectsNothing, TestScratchRenamePlusEditSelectsTest, TestScratchPythonDeletedViaHunkHeader (fixture verified to emit '@@ def test_gone(' hunk header), TestScratchUntrackedFileContributesAll, TestScratchDeletedTestDeclaredInOtherChangedFileIsKept (fixture verified '@@ func TestMoved(' in a_test.go while TestMoved declared in b_test.go → kept), TestScratchDeletedFileSelectsNothing, TestScratchEditedTestStillSelected, TestScratchDeletedNameBlocksSameNameInUntrackedFile
CGO_ENABLED=0 go test -run TestScratchRunDropsDeletedTestEndToEnd — PASS: full prove.Run on a fix+test-deletion change yields report.Tests=[TestAtThree:proven], outcome proven, no test_not_run for the deleted TestGone (fixture verified to emit '@@ func TestGone(' hunk header)
Raw runtime output was retained in local Gitmoot state and is not posted here.
Independent review-only job local-review-review-router-18d8cce018b3e4d5-1 (g7-review, devin/swe-2) approved exact head 34499a1685f73d95a7f2c3bb434700e6d19f6bda with no open findings. CI is green at this head. Merged locally onto current main (with #2): vet and go test ./... are clean. Merging.
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
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.
Found while trying test-check on gitmoot (gitmoot#2261): tests the change deleted were still selected for per-test proving, then reported
test_not_run. A test declaration on a removed line now clears the current test, so the deleted body is not attributed to any test; a rename still selects the new name. Regression testTestChangedTestNamesSkipsDeletedAndRenamedAwayTestsfails on main ([TestKeep TestGone TestNewName]) and passes here.