Skip to content

fix(update): make TestExtractBinaryZip arch-aware - #205

Merged
Desperado merged 1 commit into
mainfrom
fix/arm64-zip-test
Sep 18, 2026
Merged

Desperado merged 1 commit into
mainfrom
fix/arm64-zip-test

Conversation

@Desperado

Copy link
Copy Markdown
Contributor

Summary

TestExtractBinaryZip built its fixture archive with a hardcoded qmax-code-windows-amd64.exe member, but extractBinary (internal/update/update.go:280) looks up the host architecture via runtime.GOARCH. On any arm64 host the fixture and the lookup disagree, and the test fails with qmax-code-windows-arm64.exe not found in archive before the bytes-equal assertion is ever reached. The member name now uses runtime.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

  • Behavior-neutral for amd64: the generated member name is identical there
  • internal/update/update.go and 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 on go vet, not gofmt
  • Full package suite verified on both linux/arm64 and linux/amd64 under Go 1.25

Review 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

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.
@qualitymaxapp

qualitymaxapp Bot commented Sep 15, 2026

Copy link
Copy Markdown

QualityMax Review

Verdict: COMMENT · Confidence: evidence-backed scan

Files eligible: 1 · Files reviewed: 1 · Files with findings: 0 · Findings: 0 · Inline cards: 0

Priority findings

priority location finding
No blocking findings

Review gates

gate status
AI diff review completed · eligible 1, reviewed 1 · LLM · served gemini-3.1-flash-lite
SAST completed · eligible 1, reviewed 1 · hybrid · served qwen3.7-plus
Overall review evidence clean
Inline evidence not needed

Important files

file risk note next step
No findings

Review lifecycle

Use 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. @qmax Q&A is tracked separately.

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 c55c373453deaf59c73b232e2921899f8569501c · run 2026-09-15T15:41:21+00:00 · model served qwen3.7-plus, gemini-3.1-flash-lite · model requested qwen3.7-plus, gemini-3.1-flash-lite · model review recorded — 631 model output tokens · model source repository ai_review_preferences.preferred_model · re-review 2 · proof counts {}

@qualitymaxapp qualitymaxapp Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

QualityMax Review — canonical overview updated; inline findings are attached to this review.

@qualitymaxapp

qualitymaxapp Bot commented Sep 15, 2026

Copy link
Copy Markdown

⚠️ QualityMax Pipeline

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

@Desperado
Desperado marked this pull request as ready for review September 15, 2026 21:34
@Desperado
Desperado merged commit 62f618b into main Sep 18, 2026
6 checks passed
@Desperado
Desperado deleted the fix/arm64-zip-test branch September 18, 2026 08:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test(update): TestExtractBinaryZip fails on arm64 hosts — archive member hardcodes amd64

1 participant