_resolve_test_rel: absolute-py regex mis-matches the / in tests/test_ #1
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Analysis
_resolve_test_rel()inbullpen-grinderhas a regex ordering bug that makes it impossible to usetests/test_<name>.pyas a SPEC path without triggering the wrong match.The bug
The regex chain (line 497-519 of bullpen-grinder on boltzmann at
/usr/local/bin/bullpen-grinder):When the body contains
tests/test_namespace_query.py, the absolute regexr"/[\w./-]+\.py\b"matches the/betweentests/andtest_. It returns/test_namespace_query.pyinstead of the correcttests/test_namespace_query.py.The absolute regex fires at
/test_because[\w./-]+greedily consumestest_namespace_queryand.py\bmatches the suffix.Impact
/test_namespace_query.pyis an absolute path but wrong — it's not the real location. The coordinator then either:_remote_grindwhereos.path.join(work, "/abs/path")discards the worktree (related bug)_repo_test_filescan't find a bare/test_*.pyat the repo rootNo SPEC path with a
tests/prefix can resolve correctly through the regex chain.Workaround
Two formats that work:
test_namespace_query.pyalone in the body — falls through to named-file resolutionSPEC: /tmp/bullpen-build/.../tests/test_namespace_query.py\nREPO: /tmp/bullpen-build/.../— matches the absolute regex correctly (but hits the os.path.join bug)Room reference
Observed on hertz (room) + noether (bullpen-grinder --serve py):
INVALID TICKET ❌ — /test_namespace_query.py does not exist in /tmp/...Every dispatch using
SPEC: tests/test_namespace_query.py repo=...format produced/test_namespace_query.py.Hosts
--serve pycoordinator — where_resolve_test_relruns/usr/local/bin/bullpen-grinderSuggested fix
The absolute regex should be guarded to only match at a word/whitespace boundary before the leading
/, or moved below thetests/relative regex in the chain. E.g.: