Conversation
The two multi-valued supportedArchitectures tests added in #11375 used 'current' alongside a value that the negation in the wanted platform matched on some hosts (e.g. ['linux', 'current'] on Windows expands to ['linux', 'win32'], which is correctly rejected by ['!win32']). Replace 'current' with fixed second values so the multi-value code path is still exercised without depending on process.platform / process.arch.
Restores the more realistic scenario from #11375 where supportedArchitectures mixes a fixed value with 'current'. Mock process.platform / process.arch explicitly per test so the result no longer depends on the host CI runner.
zkochan
added a commit
that referenced
this pull request
Apr 30, 2026
* test: make checkPlatform negation tests platform-independent The two multi-valued supportedArchitectures tests added in #11375 used 'current' alongside a value that the negation in the wanted platform matched on some hosts (e.g. ['linux', 'current'] on Windows expands to ['linux', 'win32'], which is correctly rejected by ['!win32']). Replace 'current' with fixed second values so the multi-value code path is still exercised without depending on process.platform / process.arch. * test: mock process.platform / process.arch instead of avoiding 'current' Restores the more realistic scenario from #11375 where supportedArchitectures mixes a fixed value with 'current'. Mock process.platform / process.arch explicitly per test so the result no longer depends on the host CI runner.
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
supportedArchitecturesnegation tests added in fix: negatedos/cpuskipped under multi-platformsupportedArchitectures#11375 used'current'alongside a value the wanted platform's negation could match on some hosts (e.g.os: ['linux', 'current']on Windows expands to['linux', 'win32'], which is correctly rejected by['!win32']). The expectednullonly held on non-Windows runners.'current'with fixed second values ('darwin','arm64') so the multi-value code path that fix: negatedos/cpuskipped under multi-platformsupportedArchitectures#11375 fixed is still exercised, but the test result no longer depends onprocess.platform/process.arch.checkPlatformis correct and unchanged —supportedArchitecturesrequires all listed targets to be supported, and a package declaring!win32genuinely cannot satisfy a Windows host that's also asked to install forlinux.Test plan
pnpm --filter @pnpm/config.package-is-installable test(20/20 pass on macOS/arm64)