fix(b-0528): gate plutil tests on darwin (PR #3423 cross-platform follow-up)#3426
Merged
AceHack merged 1 commit intoMay 15, 2026
Merged
Conversation
Two cross-platform portability findings from PR #3423 review: - Codex P1 line 234: `plutilLint` called in-process hard-exits the test runner on non-darwin hosts when `plutil` is missing (ENOENT → plutilLint's catch calls process.exit(1)). - Copilot P0 line 98 + 167 + 229: subprocess `plutil` calls fail on non-darwin hosts, breaking the cross-platform test suite. Both real. `plutil` is a macOS-only system binary, and the LaunchAgent install path the test file exercises is also macOS-only (launchd is macOS). The pure-helper tests (xmlEscape, substitutePlaceholders, requireAbsolute, tryDetect, argument-validation via subprocess) run cross-platform. Fix: introduce `const IS_DARWIN = process.platform === "darwin"` + `const itDarwin = IS_DARWIN ? it : it.skip` and route the 4 plutil-touching test cases through `itDarwin`: - "substituted values containing & < > produce plutil-valid plist" - "writes rendered plist to stdout, not to ~/Library/LaunchAgents/" - "returns without throwing for a valid plist" (plutilLint) - "exits with code 1 (via subprocess) for an invalid plist" (plutilLint) Result on macOS: 19 pass / 0 fail (unchanged). Result on Linux (expected): 15 pass / 4 skip / 0 fail (suite remains green and the rest of the suite is reachable). Co-Authored-By: Claude <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Post-merge cross-platform follow-up to PR #3423: gates the four plutil-dependent tests in install-launchagent.test.ts to darwin only, so non-darwin CI runners don't fail (subprocess plutil ENOENT) or hard-exit (in-process plutilLint calls process.exit(1)). Pure-helper tests remain cross-platform.
Changes:
- Introduces
IS_DARWIN/itDarwin(skip-on-non-darwin variant ofit). - Applies
itDarwinto the 4 plutil-touching cases (xmlEscape integration, --dry-run, plutilLint valid, plutilLint invalid). - Adds a comment explaining the macOS-only scope.
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
Post-merge fix for PR #3423. Two P0/P1 portability findings:
plutilLintcalled in-process hard-exits the test runner on non-darwin (ENOENT →process.exit(1)).plutilcalls fail on non-darwin (line 98 + 167 + 229), breaking cross-platform test runs.Both real.
plutilis macOS-only, and the install-launchagent.ts target (launchd) is also macOS-only — so the pure-helper tests should run cross-platform but the plutil integration tests should skip.Approach
Applied
itDarwinto the 4 plutil-touching test cases. Pure helpers (xmlEscape, substitutePlaceholders, requireAbsolute, tryDetect, argument-validation via subprocess) remainitfor cross-platform coverage.Expected results
Verified on macOS: 19/19 pass.
Test plan
bunx tsc --noEmitcleanbun teston macOS: 19 pass / 0 fail (unchanged)🤖 Generated with Claude Code