fix(tests): unset hook-exported git env before running suites
Git exports GIT_DIR to the hooks it runs, so under the run-tests pre-push hook the validate-provenance-skill.bats fixtures' `git -C "$tmp"` calls resolved to this repo: 84 failures, core.bare=true and an emptied index on every push. run-tests.sh now unsets git's repo-locating variables before any suite runs. Reproduced with GIT_DIR pointed at a throwaway repo (61 failures) and verified clean after the fix (463/463). Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_012CqgnwEGtmfsjcoG9QwByN
This commit is contained in:
1 parent
c99ac96c4d
commit
9a2a3efd8e
2 files changed
+12
No files matched your search
@@ -141,3 +141,7 @@ The pre-push `run-tests` failed 2 of 3 full runs, on a different suite each time
|
||||
## 2026-09-16 — A static guard covers exactly the spellings its regex models
|
||||
|
||||
The guard added above (`tests/test-no-pipefail-early-exit-grep.sh`) reported the tree clean the day it landed, and the tree was not clean. Its pattern could not see a multi-stage pipeline (`echo x | filter | grep -q y`), a pipeline wrapped after a trailing `|`, or `set -o errexit -o pipefail` — the last a file-level miss that silently skipped every site in that file. Five live vulnerable sites sat in `tests/test-apm-current-hook.sh` while the suite reported green, and the fixtures carried 4 of the 12 vulnerable spellings that turned out to exist. A clean verdict from a static scanner is a claim about its regex, not about the tree. Fix: before trusting one, enumerate the spellings of the defect and measure the miss surface against them; and write the scanner's remit and its known false-positive shapes into the gate's own documentation, so the next reader knows what the green covers.
|
||||
|
||||
## 2026-11-13 — Hook-exported GIT_DIR turned test fixtures loose on the real repo
|
||||
|
||||
Under the `run-tests` pre-push hook, git exports `GIT_DIR` to the hook, so a bats fixture's `git -C "$tmp" init/commit/update-ref` hit this repo instead of its temp dir: 84 failures, `core.bare=true` and an emptied index on every push. The 2026-07-05 "repo root is a bare checkout" entry was likely this bug's symptom, not the repo's real shape. Fix: `tests/run-tests.sh` unsets git's repo-locating env vars before any suite runs. Rule: a test that builds its own repo must never inherit the caller's git environment.
|
||||
Reference in new issue
Block a user