authorgravatar for julius0216@outlook.comJulius Marminge <julius0216@outlook.com> 2026-09-04 13:33:24-07:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2026-09-04 20:33:24+00:00
log0a590fa01af66ec135d2ebf2d5542b08a37dc275
treeff9938bba61127737e5b3a0a249bdb096f86bcb8
parent781f41ef1f6b5054e75f77237df9eba3b7f61cc9
signature Signed by PGP key B5690EEEBB952194

test(scripts): keep Windows packaging checks host-portable (#9589)

Co-authored-by: Claude Code <noreply@anthropic.com>

2 files changed, 29 insertions(+), 20 deletions(-)

scripts/build-desktop-artifact.test.ts+9-5
...@@ -1040,6 +1040,9 @@ it.layer(NodeServices.layer)("build-desktop-artifact", (it) => {...@@ -1040,6 +1040,9 @@ it.layer(NodeServices.layer)("build-desktop-artifact", (it) => {
1040 ),1040 ),
1041 );1041 );
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.
1043 it.effect("validates every ASAR-unpacked native in the packaged Windows payload", () =>1046 it.effect("validates every ASAR-unpacked native in the packaged Windows payload", () =>
1044 Effect.scoped(1047 Effect.scoped(
1045 Effect.gen(function* () {1048 Effect.gen(function* () {
...@@ -1068,7 +1071,7 @@ it.layer(NodeServices.layer)("build-desktop-artifact", (it) => {...@@ -1068,7 +1071,7 @@ it.layer(NodeServices.layer)("build-desktop-artifact", (it) => {
1068 assert.isBelow(result.fileCount, WINDOWS_PACKAGED_PAYLOAD_FILE_LIMIT);1071 assert.isBelow(result.fileCount, WINDOWS_PACKAGED_PAYLOAD_FILE_LIMIT);
1069 assert.deepStrictEqual(secondAsar, firstAsar);1072 assert.deepStrictEqual(secondAsar, firstAsar);
1070 }),1073 }),
1071 ),1074 ).pipe(Effect.provideService(HostProcessPlatform, "linux")),
1072 );1075 );
10731076
1074 it.effect("validates the emitted WSL archive and its SHA-256 sidecar", () =>1077 it.effect("validates the emitted WSL archive and its SHA-256 sidecar", () =>
...@@ -1087,7 +1090,7 @@ it.layer(NodeServices.layer)("build-desktop-artifact", (it) => {...@@ -1087,7 +1090,7 @@ it.layer(NodeServices.layer)("build-desktop-artifact", (it) => {
10871090
1088 assert.equal(result.packagedAppDir, fixture.packagedAppDir);1091 assert.equal(result.packagedAppDir, fixture.packagedAppDir);
1089 }),1092 }),
1090 ),1093 ).pipe(Effect.provideService(HostProcessPlatform, "linux")),
1091 );1094 );
10921095
1093 it.effect("rejects a Windows package missing its expected WSL runtime", () =>1096 it.effect("rejects a Windows package missing its expected WSL runtime", () =>
...@@ -1235,11 +1238,12 @@ it.layer(NodeServices.layer)("build-desktop-artifact", (it) => {...@@ -1235,11 +1238,12 @@ it.layer(NodeServices.layer)("build-desktop-artifact", (it) => {
1235 command.args.some((arg) => arg.endsWith("build-browser-secret.mjs")),1238 command.args.some((arg) => arg.endsWith("build-browser-secret.mjs")),
1236 );1239 );
1237 assert.isDefined(helper);1240 assert.isDefined(helper);
1241 const path = yield* Path.Path;
1238 assert.deepStrictEqual(helper.args.slice(-4), [1242 assert.deepStrictEqual(helper.args.slice(-4), [
1239 "--arch",1243 "--arch",
1240 "x64",1244 "x64",
1241 "--output",1245 "--output",
1242 "/stage/resources/browser-secret/t3-browser-secret",1246 path.join("/stage/resources", "browser-secret", "t3-browser-secret"),
1243 ]);1247 ]);
1244 }).pipe(1248 }).pipe(
1245 Effect.provide(1249 Effect.provide(
...@@ -1461,7 +1465,7 @@ it.layer(NodeServices.layer)("build-desktop-artifact", (it) => {...@@ -1461,7 +1465,7 @@ it.layer(NodeServices.layer)("build-desktop-artifact", (it) => {
1461 assert.instanceOf(error, BundleNotSelfContainedError);1465 assert.instanceOf(error, BundleNotSelfContainedError);
1462 assert.include(error.output, "t3code-deliberately-missing-package");1466 assert.include(error.output, "t3code-deliberately-missing-package");
1463 }),1467 }),
1464 ),1468 ).pipe(Effect.provideService(HostProcessPlatform, "linux")),
1465 );1469 );
14661470
1467 it.effect("preserves both Linux icon resize failures with structural context", () => {1471 it.effect("preserves both Linux icon resize failures with structural context", () => {
...@@ -1701,7 +1705,7 @@ it.layer(NodeServices.layer)("build-desktop-artifact", (it) => {...@@ -1701,7 +1705,7 @@ it.layer(NodeServices.layer)("build-desktop-artifact", (it) => {
1701 assert.equal(config.appId, "com.t3tools.t3code");1705 assert.equal(config.appId, "com.t3tools.t3code");
1702 assert.equal(mac.entitlements, "/tmp/entitlements.mac.plist");1706 assert.equal(mac.entitlements, "/tmp/entitlements.mac.plist");
1703 assert.equal(mac.provisioningProfile, "/tmp/t3code.provisionprofile");1707 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$/);
1705 assert.deepStrictEqual(mac.protocols, [1709 assert.deepStrictEqual(mac.protocols, [
1706 { name: "T3 Code", schemes: ["t3code", "t3code-dev"] },1710 { name: "T3 Code", schemes: ["t3code", "t3code-dev"] },
1707 ]);1711 ]);
scripts/lib/cli-external-packages.test.ts+20-15
...@@ -153,21 +153,26 @@ it.layer(NodeServices.layer)("external package dependency closure", (it) => {...@@ -153,21 +153,26 @@ it.layer(NodeServices.layer)("external package dependency closure", (it) => {
153 const isRuntimeExternal = (name: string) =>153 const isRuntimeExternal = (name: string) =>
154 CLI_RUNTIME_EXTERNAL_PREFIXES.some((prefix) => name.startsWith(prefix));154 CLI_RUNTIME_EXTERNAL_PREFIXES.some((prefix) => name.startsWith(prefix));
155155
156 it.effect("finds the runtime-external packages on disk", () =>156 // A cold walk of the pnpm store can exceed the root timeout when the Windows
157 Effect.gen(function* () {157 // lane runs four filesystem-heavy workspace suites at once.
158 const installed = yield* readInstalledPackages;158 it.effect(
159 const found = [...installed.keys()].filter(isRuntimeExternal);159 "finds the runtime-external packages on disk",
160160 () =>
161 // Without this the closure check below can pass vacuously: if nothing is161 Effect.gen(function* () {
162 // read, nothing is checked. These are the packages whose closure actually162 const installed = yield* readInstalledPackages;
163 // broke WSL, so require them by name.163 const found = [...installed.keys()].filter(isRuntimeExternal);
164 for (const required of ["node-pty", "node-gyp-build-optional-packages", "detect-libc"]) {164
165 assert.ok(165 // Without this the closure check below can pass vacuously: if nothing is
166 found.includes(required),166 // read, nothing is checked. These are the packages whose closure actually
167 `expected ${required} in the pnpm store; the closure check is only meaningful if it can read these (found ${found.length})`,167 // broke WSL, so require them by name.
168 );168 for (const required of ["node-pty", "node-gyp-build-optional-packages", "detect-libc"]) {
169 }169 assert.ok(
170 }),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,
171 );176 );
172177
173 it.effect("keeps every runtime dependency of an external package external too", () =>178 it.effect("keeps every runtime dependency of an external package external too", () =>