MCPcopy Index your code
hub / github.com/codehamr/codehamr / TestAssetNameMatchesGoreleaserMatrix

Function TestAssetNameMatchesGoreleaserMatrix

internal/update/drift_test.go:85–99  ·  view source on GitHub ↗

TestAssetNameMatchesGoreleaserMatrix asserts the set of platforms assetName resolves is EXACTLY the set goreleaser builds: no more, no less. Derived from .goreleaser.yaml, not from a hardcoded mirror, so a future matrix edit that outpaces assetName fails here loudly instead of after a real release.

(t *testing.T)

Source from the content-addressed store, hash-verified

83// from .goreleaser.yaml, not from a hardcoded mirror, so a future matrix edit
84// that outpaces assetName fails here loudly instead of after a real release.
85func TestAssetNameMatchesGoreleaserMatrix(t *testing.T) {
86 matrix := goreleaserMatrix(t)
87 supported := assetNameSupported(matrix)
88
89 for k := range matrix {
90 if _, ok := supported[k]; !ok {
91 t.Errorf("%s/%s: goreleaser builds it but assetName returns ok=false - those users would silently never auto-update; add a case to assetName", k.os, k.arch)
92 }
93 }
94 for k := range supported {
95 if !matrix[k] {
96 t.Errorf("%s/%s: assetName resolves it but goreleaser doesn't build it - Apply would 404; remove it from assetName or add it to .goreleaser.yaml", k.os, k.arch)
97 }
98 }
99}
100
101// TestPublishedManifestMatchesAssetName is opt-in: point CODEHAMR_CHECK_MANIFEST
102// at a goreleaser checksums file (CI sets it to dist/codehamr_checksums.txt after

Callers

nothing calls this directly

Calls 2

goreleaserMatrixFunction · 0.85
assetNameSupportedFunction · 0.85

Tested by

no test coverage detected