Repository navigation
test(platform): count tests that redefine process.platform or process.arch - #11102
Merged
morluto merged 1 commit intoNov 15, 2026
Merged
Conversation
….arch Tests select a host by injection. A redefined process.platform stops exercising its branch once the module under test reads HOST_PLATFORM, and still passes. A counted baseline (105 sites in 20 files) may only shrink; each module migration switches its tests to injection.
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Contributor
[Low impact] The PR appears safe to merge. SummaryAdds
Reviews (1) · Last reviewed commit: "test(platform): count tests that redefin..." · Reviewed by Greptile |
morluto
added a commit
that referenced
this pull request
Nov 15, 2026
….arch (#11102) Tests select a host by injection. A redefined process.platform stops exercising its branch once the module under test reads HOST_PLATFORM, and still passes. A counted baseline (105 sites in 20 files) may only shrink; each module migration switches its tests to injection.
19 tasks
morluto
added a commit
that referenced
this pull request
Nov 15, 2026
…rkspace roots (#11086) * refactor(android): take the host in JADX configuration, doctor and workspace roots * fix(android): pass the host in verifiers, follow it for JAVA_HOME, and test the native cache split * test(platform): count tests that redefine process.platform or process.arch (#11102) Tests select a host by injection. A redefined process.platform stops exercising its branch once the module under test reads HOST_PLATFORM, and still passes. A counted baseline (105 sites in 20 files) may only shrink; each module migration switches its tests to injection.
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
Adds a counted architecture guard against tests that redefine
process.platformorprocess.arch. Part of the HostPlatform migration (W8). Stacked on #11086.Problem and expected behavior
Production modules now take the host from
src/platform/HostPlatform(or a parameter). A test that redefinesprocess.platformkeeps passing after its module migrates but stops exercising the branch it was written for;windowsNativeControlCapability.test.tsdid this until #11088. Tests should inject the platform (parameter,hostoption, or a mock of HostPlatform).Change and scope
scripts/verify/architecture-guards.mjs: atest-host-platform-stubcounted guard over test, spec and fixture files insrc/and every.tsfile undertests/, matchingdefineProperty(process, "platform"|"arch"andspyOn(process, "platform"|"arch"(also onglobalThis.process).--shrink-baselines.nativeUiVerifierActions,debuggerOneShotExit) are counted too; they go when their verifier or module takes an injected host.Contract and boundary impact
src/platform/HostPlatformstays the single host reader; this guards the test side.docs/public/product-catalog.json), package, or installation impact (CI generates and validates ignored catalogs andskills/; edit authored instructions in.agents/skills/reverse-engineer-anything/and never commit build outputs): none.Expected effects (check known effects; use documentation-only on its own).
Unchecked items do not establish absence; leave uncertainties visible.
Evidence and regression coverage
src/zzGuardProbe.test.tscontainingObject.defineProperty(process, "arch", { value: "x64" });made the guard fail withsrc/zzGuardProbe.test.ts: 1 (baseline 0); probe removed.vi.stubGlobal("process", ...)); none redefine platform or arch today.Validation performed
node scripts/verify/architecture-guards.mjs— passed (2839 source files).check:fast) — passed.Compatibility, safety, and release
Author readiness
Human owner:
Before merge
type(scope): outcome.