Skip to content

Fail pre-review's pre-push check on a test a merge dropped - #1199

Open
dfed wants to merge 8 commits into
claude/stacked-pull-request-checkfrom
claude/pre-review-dropped-tests
Open

dfed wants to merge 8 commits into
claude/stacked-pull-request-checkfrom
claude/pre-review-dropped-tests

Conversation

@dfed

@dfed dfed commented Nov 30, 2026 •

Copy link
Copy Markdown
Owner

Requested by Dan · project thread

Summary

Builds on #1215 and lands after it.

A merge that resolves a conflict by taking one side can drop tests the base added. Nothing noticed when that happened: the suite still passes without them, and the coverage checks only see lines, not tests.

pre-review.py --pre-push now has a step, "dropped tests", that reads every test under Tests at the base (the commit named, not the merge base, which after a merge is the base itself) and at the head.

A test the base has and the head lacks Outcome
has the same body, or one nine tenths alike, under a new name counted as renamed
is removed by one of the branch's own non-merge commits listed with that commit; does not fail
anything else fails the step, named with its file

A test is named by its function wherever its file is, so one that moved between files is not missing. The step takes about half a minute on this repository's tests.

Generated output: unchanged

Tests

The skill's self-test gains cases for reading a file's tests (a helper is none, a body does not end inside a multi-line string, and a parameterized test whose arguments hold source text is the function after the arguments), the rename match, two tests of one name, the commit that removes a name, and the step's three outcomes; a block without the step is not a pass. The step was also run on a real branch whose merges had dropped tests, and named them.

Found and not fixed

  • A branch that deletes a test in a merge commit on purpose fails the step. Left: delete it in a commit of its own, which the step then lists.

https://claude.ai/code/session_01HLuVQLHq43QvdYBYGWTdSo

https://claude.ai/code/session_01HLuVQLHq43QvdYBYGWTdSo


Generated by Claude Code

A merge that resolves a conflict by taking one side can drop tests the
base added, and nothing noticed: the suite still passes without them.

`pre-review.py --pre-push` now reads every test under Tests at the base
and at the head. A test is named by its function wherever its file is.
One whose body is the same, or nine tenths alike, under a new name is
counted as renamed; one a commit of the branch removes is listed with
that commit; any other test the base has and the head lacks fails the
check and is named. It takes about half a minute.

Generated output: unchanged

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HLuVQLHq43QvdYBYGWTdSo
@dfed dfed self-assigned this Nov 30, 2026
The arguments of a parameterized test may hold Swift source with functions
of its own. The function after the attribute is the next one at the
attribute's indentation, so such a test is no longer read as missing.

Generated output: unchanged

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HLuVQLHq43QvdYBYGWTdSo
@dfed
dfed marked this pull request as ready for review November 30, 2026 15:58
@dfed
dfed changed the base branch from main to claude/stacked-pull-request-check December 3, 2026 20:50
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.

2 participants