fix(ci): resolve macOS and Windows test failures in release builds#352
Merged
Conversation
The v0.38.0 and v0.39.0 release builds failed on macOS (7 tests) and Windows (1 test) while PR CI (ubuntu-only) passed green. Root causes: 1. macOS `/var` → `/private/var` symlink: `mkdtempSync` returns `/var/folders/…` but `process.cwd()` after `chdir()` resolves the symlink, causing path mismatches in session-context and import tests. Fix: wrap `mkdtempSync` with `realpathSync`. 2. macOS `Bun.which()` returns null for proto shims: on ARM64 runners where bun/git are installed via proto, `Bun.which` can't find them. Fix: `test.skipIf` guards on PATH-presence tests. 3. Windows timeout: `bun test` (5s default) vs `bun run test` (60s from package.json). Fix: use `bun run test` in the release-binaries workflow Windows step. Signed-off-by: Rhuan Barreto <rhuan@barreto.work>
Deploying archgate-cli with
|
| Latest commit: |
d456163
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://eaa19d36.archgate-cli.pages.dev |
| Branch Preview URL: | https://fix-release-binaries-multipl.archgate-cli.pages.dev |
Contributor
Code Coverage
Full HTML report available in workflow artifacts. Per-directory breakdown
|
The "finds bun on PATH" and "finds git on PATH" tests assert CI environment state, not application logic. They fail on macOS ARM64 runners where proto shims make Bun.which return null. Remove them entirely — the non-existent command and WSL fallback tests already cover resolveCommand's actual behavior. Signed-off-by: Rhuan Barreto <rhuan@barreto.work>
Remove tests that assert CI environment state rather than code logic: - platform.test.ts: drop "runtime matches process.platform" (tautological), "isWindows/isMacOS/isLinux matches process.platform" (mirrors runner OS), "isSupportedPlatform returns true" (same), and two isWSL/wslDistro tests that were no-ops on Linux (wrapped in if-guards, not test.skipIf). - git.test.ts: rewrite with mocked Bun.which to test actual installGit logic (fast path, slow path fallback) instead of asserting git exists. Tag isLinux() as @public since it's part of the platform helper API but has no runtime consumers yet (knip would flag it otherwise). Signed-off-by: Rhuan Barreto <rhuan@barreto.work>
…m gates Replace `if (process.platform !== ...) return` patterns with `test.skipIf(...)` across platform.test.ts, binary-upgrade.test.ts, tls.test.ts, and git.test.ts. This makes skipped tests visible in the test runner output instead of silently passing with no assertions. Split if/else branching tests (getManualInstallHint, tlsHintMessage) into separate test.skipIf tests for each platform branch. Signed-off-by: Rhuan Barreto <rhuan@barreto.work>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
/var→/private/varsymlink path mismatch in temp dirsbun test(5s default) instead ofbun run test(60s)resolveCommandPATH tests resilient to macOS ARM64 CI runners whereBun.whichreturns null for proto-installed shimsThese failures appeared in v0.38.0 and v0.39.0 release builds but were invisible in PR CI (ubuntu-only).
What changed
.github/workflows/release-binaries.ymlbun test→bun run teston Windows validate steptests/commands/session-context/*.test.ts(4 files)mkdtempSyncwithrealpathSyncto normalize macOS symlink pathstests/commands/adr/import.test.tsrealpathSyncfix for bothtempDirandupstreamDirtests/helpers/platform.test.tstest.skipIfguards whenBun.whichcan't find bun/git on PATHRoot causes
macOS
/varsymlink:mkdtempSync(join(tmpdir(), ...))returns/var/folders/...butprocess.cwd()afterchdir()resolves the symlink to/private/var/folders/.... Tests comparingtempDiragainstfindProjectRoot()output fail because the paths differ.Bun.whichon macOS ARM64 CI: When tools are installed via proto toolchain shims (not direct PATH binaries),Bun.which("bun")andBun.which("git")return null. Production code handles this gracefully but tests that assert non-null results fail.Windows test timeout: The package.json
testscript includes--timeout 60000, but barebun testuses Bun's default 5s timeout. Session-context tests that perform filesystem I/O exceed 5s on Windows CI runners.Test plan
bun run validatepasses locally (1199 pass, 15 skip, 0 fail, 27/27 ADR checks)release-binaries.yml)