From e54be76cf0b1f19005242b5d9a0b60f9c0f83244 Mon Sep 17 00:00:00 2001 From: Jakub Zych Date: Sat, 14 Nov 2026 16:00:23 +0100 Subject: [PATCH] test(35): self-test compares the planted consumer's go.mod - the workspace-modfile case copies the planted consumer's go.mod before the modfile run and compares it after with cmp -s (IN-03) - drops the git status check on the dirty-sibling fixture, which asserted against the wrong repository; the replace-line grep stays --- scripts/check-phase35.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/check-phase35.sh b/scripts/check-phase35.sh index 288c8867..e22aafc9 100755 --- a/scripts/check-phase35.sh +++ b/scripts/check-phase35.sh @@ -609,6 +609,8 @@ self_test_consumers() { echo "refuse: self-test workspace_check refused a consumer that resolves the framework to the expected checkout" >&2 return 1 fi + # A copy of the planted consumer's go.mod, compared after the modfile run. + cp "$consumer/go.mod" "$tmp/consumer-go.mod.before" rc=0 out="$(ROOT="$fw" GOWORK=off GOPROXY=off GOFLAGS= GOTOOLCHAIN=local workspace_check "$consumer" "-mod=mod -modfile=$mod/go.mod" 2>&1)" || rc=$? if [[ "$rc" -eq 0 ]] || ! grep -q "^refuse: $consumer resolves git.golem15.com/golem15/summercms to .*elsewhere" <<<"$out"; then @@ -616,7 +618,7 @@ self_test_consumers() { echo "refuse: self-test workspace_check under a scratch modfile accepted a framework that resolves elsewhere (exit $rc)" >&2 return 1 fi - if [[ -n "$(git -c safe.directory='*' -C "$repo" status --porcelain -- go.mod)" ]] || ! grep -q '=> ../framework' "$consumer/go.mod"; then + if ! cmp -s "$tmp/consumer-go.mod.before" "$consumer/go.mod" || ! grep -q '=> ../framework' "$consumer/go.mod"; then echo "refuse: self-test the modfile run wrote the planted consumer's go.mod" >&2 return 1 fi