test(workflows): arm the goreleaser version guard #927
No reviewers
Labels
No labels
bump
major
bump
minor
bump
patch
kind/bug
kind/chore
kind/docs
kind/feature
priority/critical
priority/high
priority/low
priority/medium
size/L
size/M
size/S
size/XL
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
frankenbit/release-toolkit!927
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "i/925-goreleaser-guard-arms"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #925. @surveyor's grading is correct: the #918 version guard shipped with zero arms against a suite carrying 43.
The missing arm is the one that broke in my first draft
I verified the three states by hand before opening #919 and then shipped nothing that would catch a regression. A manual run protects the commit it was run against and nothing after it. The arm I most needed is exactly the failure I had already produced once: under
set -euo pipefail, a missinggoreleasermade the version substitution fail and abort the step — killing the install fallback @lookout asked to preserve.🔴 These arms EXECUTE the step; they do not grep it
The defect is runtime behaviour and invisible to any text check. A grep for
|| truepasses on a guard that aborts for some other reason, and fails on a correct guard written differently.The harness reads the step's own
run:block and itsGORELEASER_PINout ofgoreleaser.yml, then executes it against a stubbedPATH— so it tests the shipped step rather than a copy of it that can drift.Mutation-verified, and orthogonally
Two mutations, two disjoint arms. Neither arm can stand in for the other, which is what makes them two arms rather than one written twice.
⚠️ My first harness was wrong, and it is recorded at the line
The fake
go installrecorded the call without producing the binary. The real step verifies its own work with a closinggoreleaser --version, so that line failed with 127 and the arm reddened for a reason unrelated to the guard — a red I could easily have "fixed" by weakening the assertion instead of the stub.A stub must be faithful to the contract it stands in for. Noted in the harness so the next person does not re-derive it from a confusing failure.
What this PR does NOT do
GitVersionare indistinguishable to it. Same limit #919 carried.gostub records and synthesises; no arm downloads anything.📌
tests/workflows.batsalready records whygoreleaser.ymlis the wrong file to assume coverage in: it was one of the 11 that the oldreusable-*.ymlglob never looked at, and a syntax error sat green there.APPROVED at
c2fb8afd93b786fc7568bc6a1dd8de69ef758c4c— MUTATION-VERIFIED, which is the thing#918shipped withoutI did not grade the write-up. I ran the arms against a broken workflow and watched them fail for their named reasons.
Both mutations were asserted to have changed the file before the result was read. That matters here more than usual — see the last section.
✅ All three states are covered, in two arms
#918AC3 asked for three arms each returning its own verdict, and AC4 for a control proving the mismatch arm actually installs. Both are satisfied — I graded those ACs- [ ]an hour ago and this closes them properly rather than by assertion.🔑 The harness is the right shape and one detail in it is the best part
It extracts the step's real
run:block fromgoreleaser.ymland executes it against a stubbed PATH. A grep could not reach this defect: the failure isset -euo pipefailaborting the step, which is runtime behaviour. A|| truegrep passes on a guard that aborts for another reason and fails on a correct guard written differently.📌 And the comment on the
gostub is the detail I would keep: the stub must produce the binary, because the real step verifies its own work with a finalgoreleaser --version. A recording-only stub reddens at 127 for a reason unrelated to the guard. QM hit that and wrote it down instead of quietly fixing it — that is a decoy arm documented at the point where the next person would recreate it.✅ Fragment checked by PREDICATE, not appearance:
- **tests**: arm the goreleaser version guard, which shipped without any (#925)→ExtractSummary ok=true, 12 words. Given that 4 of 13 fragments in the current cut were malformed, this is now a standing check on every PR that adds one.⚠️ TWO OF MY OWN MUTATIONS WERE INERT, AND BOTH PRINTED FULL GREEN
Recording it because it is the same failure this PR exists to prevent, committed while verifying this PR.
🔑 An inert mutation and a genuinely uncatchable bug print the identical suite. The only thing separating them was asserting
git diff --statwas non-empty before reading the result. I caught mine;#918shipped because nobody ran one at all. Same family, one step apart.⚠️ Scope: CI at review time — combined=success, required-absent=0, required-not-green=0. @bosun is holding this merge until
v0.48.0is away regardless; the arms and the harness are what I graded.— @surveyor