Skip to content

Commit 1628b09

Browse files
kriscendobotclaude
andcommitted
test(triager): lock GARDEN_REPOS default to worktrees/ (case I)
The wrong-default outage (GARDEN_REPOS defaulting to the un-provisioned $GARDEN_ROOT/repos, which killed every triager tick) was fixed in the code by 118f738 / 9ad9c72, but no test guards the DEFAULT: every existing case sets GARDEN_REPOS explicitly, so a future edit could silently regress the default back to /repos undetected. Add case I — run with GARDEN_REPOS UNSET and a controlled GARDEN_ROOT and assert the resolved BARE the skip log names sits under worktrees/, never repos/. 44 pass. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent dabded8 commit 1628b09

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

scripts/jobs/test/triager-test.sh

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,35 @@ grep -q "no bare clone at .*$NOSLUG.git on this host; skipping triage" "$SKIPOUT
328328
&& ok "skip log names the missing clone and the host-local reason" || bad "skip log missing (want 'no bare clone … on this host; skipping triage')"
329329
[ ! -s "$CALLS" ] && ok "handler never invoked (nothing to diff without the clone)" || bad "handler ran ($(grep -c . "$CALLS") calls; want 0)"
330330

331+
# ============================================================================
332+
hr; echo "I — default GARDEN_REPOS resolves to \$GARDEN_ROOT/worktrees, not /repos"; hr
333+
# Regression guard for the original defect: GARDEN_REPOS defaulted to
334+
# \$GARDEN_ROOT/repos, a path nothing provisions, so BARE was unresolvable and EVERY
335+
# tick died. The canonical standing-bare-clone location is \$GARDEN_ROOT/worktrees
336+
# (ensure-project-worktree.sh, clone-keeper.sh, WORKTREES.md). Run with GARDEN_REPOS
337+
# UNSET and a controlled GARDEN_ROOT; the resolved $BARE the skip log names must sit
338+
# under worktrees/, never repos/. (Every other case sets GARDEN_REPOS explicitly, so
339+
# without this case the default could silently regress to /repos undetected.)
340+
rm -rf "$TR/state8"; STATE="$TR/state8"
341+
GROOT="$TR/groot"; rm -rf "$GROOT"; mkdir -p "$GROOT/worktrees" # canonical clone dir exists, empty
342+
DEFOUT="$TR/triager-default.out"; : > "$DEFOUT"; : > "$CALLS"
343+
set +e
344+
env GARDEN=testhost GARDEN_ROOT="$GROOT" GARDEN_STATE="$STATE" \
345+
JOURNAL_REMOTE="$BARE" JOURNAL_BRANCH="$BRANCH" \
346+
GARDEN_WATCH_REF="$REF" \
347+
GARDEN_TRIAGE_HANDLER="$HANDLER" HANDLER_RC=0 CALL_LOG="$CALLS" \
348+
GARDEN_TRIAGE_FAIL_THRESHOLD=5 \
349+
"$JOBS/triager.sh" "$SLUG" >>"$DEFOUT" 2>&1 # NOTE: GARDEN_REPOS deliberately unset
350+
rc=$?
351+
set -e
352+
[ "$rc" -eq 0 ] && ok "default-path tick exits 0" || bad "tick exit = $rc (want 0)"
353+
grep -q "no bare clone at $GROOT/worktrees/$SLUG.git" "$DEFOUT" \
354+
&& ok "default resolved BARE under worktrees/ (\$GARDEN_ROOT/worktrees/$SLUG.git)" \
355+
|| bad "default did NOT resolve under worktrees/ (log: $(grep 'no bare clone' "$DEFOUT" || echo '<none>'))"
356+
! grep -q "no bare clone at $GROOT/repos/$SLUG.git" "$DEFOUT" \
357+
&& ok "default did NOT resolve under the un-provisioned repos/ (the original bug)" \
358+
|| bad "default still resolves under repos/ — the wrong-default regression is back"
359+
331360
# ============================================================================
332361
hr
333362
echo "TOTAL: $PASS passed, $FAIL failed"

0 commit comments

Comments
 (0)