test(scripts): keep Windows packaging checks host-portable (#9589)
Co-authored-by: Claude Code <[email protected]>
This commit is contained in:
1 parent
781f41ef1f
commit
0a590fa01a
2 files changed
+28
-19
No files matched your search
@@ -1040,6 +1040,9 @@ it.layer(NodeServices.layer)("build-desktop-artifact", (it) => {
|
||||
),
|
||||
);
|
||||
|
||||
// The fixture's t3code.exe is a text placeholder, not an executable. These
|
||||
// cases reach the native-load probe, so pin only that host-platform check to
|
||||
// Linux. Host-native paths and the real Windows tar/archive checks still run.
|
||||
it.effect("validates every ASAR-unpacked native in the packaged Windows payload", () =>
|
||||
Effect.scoped(
|
||||
Effect.gen(function* () {
|
||||
@@ -1068,7 +1071,7 @@ it.layer(NodeServices.layer)("build-desktop-artifact", (it) => {
|
||||
assert.isBelow(result.fileCount, WINDOWS_PACKAGED_PAYLOAD_FILE_LIMIT);
|
||||
assert.deepStrictEqual(secondAsar, firstAsar);
|
||||
}),
|
||||
),
|
||||
).pipe(Effect.provideService(HostProcessPlatform, "linux")),
|
||||
);
|
||||
|
||||
it.effect("validates the emitted WSL archive and its SHA-256 sidecar", () =>
|
||||
@@ -1087,7 +1090,7 @@ it.layer(NodeServices.layer)("build-desktop-artifact", (it) => {
|
||||
|
||||
assert.equal(result.packagedAppDir, fixture.packagedAppDir);
|
||||
}),
|
||||
),
|
||||
).pipe(Effect.provideService(HostProcessPlatform, "linux")),
|
||||
);
|
||||
|
||||
it.effect("rejects a Windows package missing its expected WSL runtime", () =>
|
||||
@@ -1235,11 +1238,12 @@ it.layer(NodeServices.layer)("build-desktop-artifact", (it) => {
|
||||
command.args.some((arg) => arg.endsWith("build-browser-secret.mjs")),
|
||||
);
|
||||
assert.isDefined(helper);
|
||||
const path = yield* Path.Path;
|
||||
assert.deepStrictEqual(helper.args.slice(-4), [
|
||||
"--arch",
|
||||
"x64",
|
||||
"--output",
|
||||
"/stage/resources/browser-secret/t3-browser-secret",
|
||||
path.join("/stage/resources", "browser-secret", "t3-browser-secret"),
|
||||
]);
|
||||
}).pipe(
|
||||
Effect.provide(
|
||||
@@ -1461,7 +1465,7 @@ it.layer(NodeServices.layer)("build-desktop-artifact", (it) => {
|
||||
assert.instanceOf(error, BundleNotSelfContainedError);
|
||||
assert.include(error.output, "t3code-deliberately-missing-package");
|
||||
}),
|
||||
),
|
||||
).pipe(Effect.provideService(HostProcessPlatform, "linux")),
|
||||
);
|
||||
|
||||
it.effect("preserves both Linux icon resize failures with structural context", () => {
|
||||
@@ -1701,7 +1705,7 @@ it.layer(NodeServices.layer)("build-desktop-artifact", (it) => {
|
||||
assert.equal(config.appId, "com.t3tools.t3code");
|
||||
assert.equal(mac.entitlements, "/tmp/entitlements.mac.plist");
|
||||
assert.equal(mac.provisioningProfile, "/tmp/t3code.provisionprofile");
|
||||
assert.match(String(mac.sign), /\/scripts\/sign-macos\.ts$/);
|
||||
assert.match(String(mac.sign), /[\\/]scripts[\\/]sign-macos\.ts$/);
|
||||
assert.deepStrictEqual(mac.protocols, [
|
||||
{ name: "T3 Code", schemes: ["t3code", "t3code-dev"] },
|
||||
]);
|
||||
|
||||
@@ -153,21 +153,26 @@ it.layer(NodeServices.layer)("external package dependency closure", (it) => {
|
||||
const isRuntimeExternal = (name: string) =>
|
||||
CLI_RUNTIME_EXTERNAL_PREFIXES.some((prefix) => name.startsWith(prefix));
|
||||
|
||||
it.effect("finds the runtime-external packages on disk", () =>
|
||||
Effect.gen(function* () {
|
||||
const installed = yield* readInstalledPackages;
|
||||
const found = [...installed.keys()].filter(isRuntimeExternal);
|
||||
// A cold walk of the pnpm store can exceed the root timeout when the Windows
|
||||
// lane runs four filesystem-heavy workspace suites at once.
|
||||
it.effect(
|
||||
"finds the runtime-external packages on disk",
|
||||
() =>
|
||||
Effect.gen(function* () {
|
||||
const installed = yield* readInstalledPackages;
|
||||
const found = [...installed.keys()].filter(isRuntimeExternal);
|
||||
|
||||
// Without this the closure check below can pass vacuously: if nothing is
|
||||
// read, nothing is checked. These are the packages whose closure actually
|
||||
// broke WSL, so require them by name.
|
||||
for (const required of ["node-pty", "node-gyp-build-optional-packages", "detect-libc"]) {
|
||||
assert.ok(
|
||||
found.includes(required),
|
||||
`expected ${required} in the pnpm store; the closure check is only meaningful if it can read these (found ${found.length})`,
|
||||
);
|
||||
}
|
||||
}),
|
||||
// Without this the closure check below can pass vacuously: if nothing is
|
||||
// read, nothing is checked. These are the packages whose closure actually
|
||||
// broke WSL, so require them by name.
|
||||
for (const required of ["node-pty", "node-gyp-build-optional-packages", "detect-libc"]) {
|
||||
assert.ok(
|
||||
found.includes(required),
|
||||
`expected ${required} in the pnpm store; the closure check is only meaningful if it can read these (found ${found.length})`,
|
||||
);
|
||||
}
|
||||
}),
|
||||
120_000,
|
||||
);
|
||||
|
||||
it.effect("keeps every runtime dependency of an external package external too", () =>
|
||||
|
||||
Reference in new issue
Block a user