fix(update): make TestExtractBinaryZip arch-aware - #205
Conversation
The fixture archive hardcoded a qmax-code-windows-amd64.exe member while extractBinary looks up the host arch (runtime.GOARCH), so the test failed on every arm64 host with "qmax-code-windows-arm64.exe not found in archive". Name the member with runtime.GOARCH like the sibling fixtures (TestExtractBinaryTarGz, TestApplySwapsBinary) already do. Production code is unchanged.
QualityMax ReviewVerdict: COMMENT · Confidence: evidence-backed scan Files eligible: 1 · Files reviewed: 1 · Files with findings: 0 · Findings: 0 · Inline cards: 0 Priority findings
Review gates
Important files
Review lifecycleUse the inline cards to inspect evidence and suggested remediation. Re-run the QualityMax review after pushing a fix; unchanged cards are identified by their stable finding marker. Dismiss with a reason through the existing QualityMax/GitHub review feedback flow. 0 prior card(s) are stale/resolved on this head. Proof legend: VERIFIED independently judged patch · REPRODUCED verified finding · GROUNDED deterministic evidence · MODEL-ONLY model judgment. QualityMax project results are available in the configured project. Receipt · commit |
|
| Gate | Result |
|---|---|
| 🔍 AI diff review | ✅ Clean · gemini-3.1-flash-lite · completed · 1 eligible / 1 reviewed · gemini-3.1-flash-lite |
| 🔍 SAST | completed · 1 eligible / 1 reviewed · qwen3.7-plus |
| 🔍 Canonical PR review delivery | completed · 0 eligible / 0 reviewed · exact-head review #5212264309 and overview #5683239927 confirmed |
| 🧪 Repo Tests | ✅ 839/839 passed (go) |
Powered by QualityMax — AI-Powered Test Automation
Summary
TestExtractBinaryZipbuilt its fixture archive with a hardcodedqmax-code-windows-amd64.exemember, butextractBinary(internal/update/update.go:280) looks up the host architecture viaruntime.GOARCH. On any arm64 host the fixture and the lookup disagree, and the test fails withqmax-code-windows-arm64.exe not found in archivebefore the bytes-equal assertion is ever reached. The member name now usesruntime.GOARCH, mirroring the already-arch-aware sibling fixtures (TestExtractBinaryTarGz,TestApplySwapsBinary). Production code is untouched.Why now
Filed as #204 after it surfaced while validating the v1.35.3 release on an arm64 machine. Every arm64 contributor currently sees a red
go test ./...locally, and any future ARM CI runner (ubuntu-24.04-arm, macOS ARM) would break the release workflow's test gate — today's releases only pass because the runner happens to be amd64.Risks / notes
internal/update/update.goand the test file carry pre-existing gofmt drift on main (import ordering, const alignment); deliberately left out of this PR to keep the diff one line — CI gates ongo vet, not gofmtReview instructions
Single-line diff in
internal/update/update_test.go; compare against the sibling pattern at line 192 in the same file. Then it's just the Fixes footer below.Closes #204