Skip to content

Commit 0a590fa

Browse files
test(scripts): keep Windows packaging checks host-portable (#9589)
Co-authored-by: Claude Code <noreply@anthropic.com>
1 parent 781f41e commit 0a590fa

2 files changed

Lines changed: 29 additions & 20 deletions

File tree

‎scripts/build-desktop-artifact.test.ts‎

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1040,6 +1040,9 @@ it.layer(NodeServices.layer)("build-desktop-artifact", (it) => {
10401040
),
10411041
);
10421042

1043+
// The fixture's t3code.exe is a text placeholder, not an executable. These
1044+
// cases reach the native-load probe, so pin only that host-platform check to
1045+
// Linux. Host-native paths and the real Windows tar/archive checks still run.
10431046
it.effect("validates every ASAR-unpacked native in the packaged Windows payload", () =>
10441047
Effect.scoped(
10451048
Effect.gen(function* () {
@@ -1068,7 +1071,7 @@ it.layer(NodeServices.layer)("build-desktop-artifact", (it) => {
10681071
assert.isBelow(result.fileCount, WINDOWS_PACKAGED_PAYLOAD_FILE_LIMIT);
10691072
assert.deepStrictEqual(secondAsar, firstAsar);
10701073
}),
1071-
),
1074+
).pipe(Effect.provideService(HostProcessPlatform, "linux")),
10721075
);
10731076

10741077
it.effect("validates the emitted WSL archive and its SHA-256 sidecar", () =>
@@ -1087,7 +1090,7 @@ it.layer(NodeServices.layer)("build-desktop-artifact", (it) => {
10871090

10881091
assert.equal(result.packagedAppDir, fixture.packagedAppDir);
10891092
}),
1090-
),
1093+
).pipe(Effect.provideService(HostProcessPlatform, "linux")),
10911094
);
10921095

10931096
it.effect("rejects a Windows package missing its expected WSL runtime", () =>
@@ -1235,11 +1238,12 @@ it.layer(NodeServices.layer)("build-desktop-artifact", (it) => {
12351238
command.args.some((arg) => arg.endsWith("build-browser-secret.mjs")),
12361239
);
12371240
assert.isDefined(helper);
1241+
const path = yield* Path.Path;
12381242
assert.deepStrictEqual(helper.args.slice(-4), [
12391243
"--arch",
12401244
"x64",
12411245
"--output",
1242-
"/stage/resources/browser-secret/t3-browser-secret",
1246+
path.join("/stage/resources", "browser-secret", "t3-browser-secret"),
12431247
]);
12441248
}).pipe(
12451249
Effect.provide(
@@ -1461,7 +1465,7 @@ it.layer(NodeServices.layer)("build-desktop-artifact", (it) => {
14611465
assert.instanceOf(error, BundleNotSelfContainedError);
14621466
assert.include(error.output, "t3code-deliberately-missing-package");
14631467
}),
1464-
),
1468+
).pipe(Effect.provideService(HostProcessPlatform, "linux")),
14651469
);
14661470

14671471
it.effect("preserves both Linux icon resize failures with structural context", () => {
@@ -1701,7 +1705,7 @@ it.layer(NodeServices.layer)("build-desktop-artifact", (it) => {
17011705
assert.equal(config.appId, "com.t3tools.t3code");
17021706
assert.equal(mac.entitlements, "/tmp/entitlements.mac.plist");
17031707
assert.equal(mac.provisioningProfile, "/tmp/t3code.provisionprofile");
1704-
assert.match(String(mac.sign), /\/scripts\/sign-macos\.ts$/);
1708+
assert.match(String(mac.sign), /[\\/]scripts[\\/]sign-macos\.ts$/);
17051709
assert.deepStrictEqual(mac.protocols, [
17061710
{ name: "T3 Code", schemes: ["t3code", "t3code-dev"] },
17071711
]);

‎scripts/lib/cli-external-packages.test.ts‎

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -153,21 +153,26 @@ it.layer(NodeServices.layer)("external package dependency closure", (it) => {
153153
const isRuntimeExternal = (name: string) =>
154154
CLI_RUNTIME_EXTERNAL_PREFIXES.some((prefix) => name.startsWith(prefix));
155155

156-
it.effect("finds the runtime-external packages on disk", () =>
157-
Effect.gen(function* () {
158-
const installed = yield* readInstalledPackages;
159-
const found = [...installed.keys()].filter(isRuntimeExternal);
160-
161-
// Without this the closure check below can pass vacuously: if nothing is
162-
// read, nothing is checked. These are the packages whose closure actually
163-
// broke WSL, so require them by name.
164-
for (const required of ["node-pty", "node-gyp-build-optional-packages", "detect-libc"]) {
165-
assert.ok(
166-
found.includes(required),
167-
`expected ${required} in the pnpm store; the closure check is only meaningful if it can read these (found ${found.length})`,
168-
);
169-
}
170-
}),
156+
// A cold walk of the pnpm store can exceed the root timeout when the Windows
157+
// lane runs four filesystem-heavy workspace suites at once.
158+
it.effect(
159+
"finds the runtime-external packages on disk",
160+
() =>
161+
Effect.gen(function* () {
162+
const installed = yield* readInstalledPackages;
163+
const found = [...installed.keys()].filter(isRuntimeExternal);
164+
165+
// Without this the closure check below can pass vacuously: if nothing is
166+
// read, nothing is checked. These are the packages whose closure actually
167+
// broke WSL, so require them by name.
168+
for (const required of ["node-pty", "node-gyp-build-optional-packages", "detect-libc"]) {
169+
assert.ok(
170+
found.includes(required),
171+
`expected ${required} in the pnpm store; the closure check is only meaningful if it can read these (found ${found.length})`,
172+
);
173+
}
174+
}),
175+
120_000,
171176
);
172177

173178
it.effect("keeps every runtime dependency of an external package external too", () =>

0 commit comments

Comments
 (0)