Commit 74671f7
committed
Pin rlcr-stop-gate project root at every wrapper testsite
tests/test-stop-hook-bg-allow.sh invokes rlcr-stop-gate.sh at four
spots (AC-9, AC-10c, AC-22, AC-22b). The wrapper resolves its
project root as `${CLAUDE_PROJECT_DIR:-$(pwd)}`, giving the env
var precedence over `cd`. When the outer runner exports
CLAUDE_PROJECT_DIR (the normal case in hosted environments),
those four tests were inspecting the outer repo instead of their
per-test fixtures, falling through with "ALLOW: stop gate
passed." and causing the suite to go red inside
tests/run-all-tests.sh.
Reproduced directly:
CLAUDE_PROJECT_DIR=/tmp/outer-unrelated \
bash tests/test-stop-hook-bg-allow.sh
...
FAIL: AC-10c
FAIL: AC-22
Fix: pass `--project-root "$FIXTURE_REPO"` at every wrapper call
site. The wrapper priority order is explicit flag >
CLAUDE_PROJECT_DIR env > cwd, so the gate now pins deterministically
to each fixture regardless of inherited environment.
No product-code change.
Validation:
- bash tests/test-stop-hook-bg-allow.sh -> 39 passed, 0 failed
- bash tests/run-all-tests.sh -> 1718 passed, 0 failed
- CLAUDE_PROJECT_DIR=/tmp/outer-unrelated bash
tests/test-stop-hook-bg-allow.sh -> 39 passed, 0 failed
- HOME=/nonexistent/readonly bash tests/test-stop-hook-bg-allow.sh
-> 39 passed, 0 failed
- TZ=America/Los_Angeles bash tests/test-stop-hook-bg-allow.sh
-> 39 passed, 0 failed
- TZ=Asia/Tokyo bash tests/test-stop-hook-bg-allow.sh
-> 39 passed, 0 failed
systemMessage wording unchanged. Version stays at 1.16.0.1 parent 9c80698 commit 74671f7
1 file changed
Lines changed: 8 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
476 | 476 | | |
477 | 477 | | |
478 | 478 | | |
| 479 | + | |
| 480 | + | |
479 | 481 | | |
480 | 482 | | |
481 | 483 | | |
482 | | - | |
| 484 | + | |
483 | 485 | | |
484 | 486 | | |
485 | 487 | | |
| |||
561 | 563 | | |
562 | 564 | | |
563 | 565 | | |
564 | | - | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
565 | 569 | | |
566 | 570 | | |
567 | 571 | | |
| |||
1307 | 1311 | | |
1308 | 1312 | | |
1309 | 1313 | | |
1310 | | - | |
| 1314 | + | |
1311 | 1315 | | |
1312 | 1316 | | |
1313 | 1317 | | |
| |||
1362 | 1366 | | |
1363 | 1367 | | |
1364 | 1368 | | |
1365 | | - | |
| 1369 | + | |
1366 | 1370 | | |
1367 | 1371 | | |
1368 | 1372 | | |
| |||
0 commit comments