tests: make the worktree-discipline remote-resolution test hermetic (kotkan/claude-plugin-inference-arbitrage#30) #32
@@ -14,7 +14,9 @@ steps:
|
||||
- name: suites
|
||||
image: alpine:3
|
||||
commands:
|
||||
- apk add --no-cache bash python3 wget >/dev/null
|
||||
# git is required by tests/filing.test.sh's hermetic worktree-discipline
|
||||
# remote-resolution fixture (kotkan/claude-plugin-inference-arbitrage#30).
|
||||
- apk add --no-cache bash python3 wget git >/dev/null
|
||||
# bin/offload-scan (design decision 0.1) deliberately never vendors
|
||||
# token-budget's pricing/token-accounting logic -- it imports the real
|
||||
# cc-tokens module and fails loudly if it's missing. This bare alpine
|
||||
|
||||
+23
-10
@@ -201,15 +201,28 @@ else
|
||||
fi
|
||||
|
||||
echo "== a writable target resolves through its own checkout's remote =="
|
||||
if [ -d ../worktree-discipline/.git ]; then
|
||||
$BIN queries --classified "$tmp/cls.json" --judgments "$JUD" \
|
||||
--target-path ../worktree-discipline >"$tmp/wd-q.json"
|
||||
check "repo" "$(q "$tmp/wd-q.json" "d['repo']")" "kotkan/claude-plugin-worktree-discipline"
|
||||
check "filing" "$(q "$tmp/wd-q.json" "d['filing']")" "available"
|
||||
check "label scan is the authoritative query" \
|
||||
"$(q "$tmp/wd-q.json" "d['queries']['label_scan']['labels']")" "['token-offload']"
|
||||
else
|
||||
echo " skip (no sibling worktree-discipline checkout)"
|
||||
fi
|
||||
# Was: read the live remote of a sibling ../worktree-discipline checkout on
|
||||
# disk. That checkout is outside this repo and outside version control, so
|
||||
# its remote can drift independently of anything here — e.g. a stale clone
|
||||
# still pointing at the pre-rename slug `kotkan/worktree-discipline` instead
|
||||
# of `kotkan/claude-plugin-worktree-discipline` (kotkan org repos were
|
||||
# renamed to the claude-plugin-<name> convention on 2026-07-22). That drift
|
||||
# produced a false "repo" mismatch (kotkan/claude-plugin-inference-arbitrage#30)
|
||||
# with nothing to fix in this repo's source or fixtures — both already agreed
|
||||
# with the current live repo name. It also meant this assertion silently
|
||||
# never ran in CI, since the bare CI container has no sibling checkout at all
|
||||
# and the test just printed "skip". A synthetic git repo with a fixed remote
|
||||
# tests the same resolve_repo()/parse_remote() code path deterministically,
|
||||
# with no dependency on what else happens to be checked out next door.
|
||||
wd_git="$tmp/wd-fixture"
|
||||
mkdir -p "$wd_git"
|
||||
git -C "$wd_git" init -q
|
||||
git -C "$wd_git" remote add origin git@git.oleks.space:kotkan/claude-plugin-worktree-discipline.git
|
||||
$BIN queries --classified "$tmp/cls.json" --judgments "$JUD" \
|
||||
--target-path "$wd_git" >"$tmp/wd-q.json"
|
||||
check "repo" "$(q "$tmp/wd-q.json" "d['repo']")" "kotkan/claude-plugin-worktree-discipline"
|
||||
check "filing" "$(q "$tmp/wd-q.json" "d['filing']")" "available"
|
||||
check "label scan is the authoritative query" \
|
||||
"$(q "$tmp/wd-q.json" "d['queries']['label_scan']['labels']")" "['token-offload']"
|
||||
|
||||
exit "$fail"
|
||||
|
||||
Reference in New Issue
Block a user