From 1fdc13fe017b7f1db52688ffe7422c3f73f4c6f7 Mon Sep 17 00:00:00 2001 From: Mika Hertler <77012401+MikaMcFlurry@users.noreply.github.com> Date: Sat, 7 Nov 2026 02:16:43 +0100 Subject: [PATCH] test(server): three more tests stop assuming a POSIX host On Windows, ThreadMessageIntake and AntigravityAdapterV2 compared against raw paths where the code writes JSON-encoded ones, so every backslash came out doubled. They now compare against the JSON-encoded path, as #30983 did for other files. The Intel Mac re-sign test simulates a macOS install, which needs POSIX execute bits that Windows never reports, so it is skipped on Windows hosts like its neighbour that simulates Linux. Co-Authored-By: Claude Opus 5.5 --- .../Adapters/AntigravityAdapterV2.test.ts | 2 +- .../ThreadMessageIntake.test.ts | 2 +- .../provider/AntigravityInstallation.test.ts | 105 +++++++++--------- 3 files changed, 57 insertions(+), 52 deletions(-) diff --git a/apps/server/src/orchestration-v2/Adapters/AntigravityAdapterV2.test.ts b/apps/server/src/orchestration-v2/Adapters/AntigravityAdapterV2.test.ts index 6a9a9b01c5aa5..0945a282cee2c 100644 --- a/apps/server/src/orchestration-v2/Adapters/AntigravityAdapterV2.test.ts +++ b/apps/server/src/orchestration-v2/Adapters/AntigravityAdapterV2.test.ts @@ -540,7 +540,7 @@ describe("AntigravityAdapterV2 workspace changes", () => { }, ], ); - assert.include(JSON.stringify(sent.prompt), documentPath); + assert.include(JSON.stringify(sent.prompt), JSON.stringify(documentPath).slice(1, -1)); if (readTextFile === undefined) { return yield* Effect.die("Antigravity sessions must serve client file requests"); } diff --git a/apps/server/src/orchestration-v2/ThreadMessageIntake.test.ts b/apps/server/src/orchestration-v2/ThreadMessageIntake.test.ts index ead417400e10f..bec9c60c7a014 100644 --- a/apps/server/src/orchestration-v2/ThreadMessageIntake.test.ts +++ b/apps/server/src/orchestration-v2/ThreadMessageIntake.test.ts @@ -135,7 +135,7 @@ it.effect("claims question uploads and passes readable paths through the V2 requ expect(NodeFS.readFileSync(path!)).toEqual(Buffer.from([1, 2, 3])); expect(command.answers?.q).toEqual([ "Selected option", - `Attached image "screen.png": "${path}"`, + `Attached image "screen.png": ${JSON.stringify(path)}`, ]); }).pipe(Effect.provide(layerIntakeTest)), ); diff --git a/apps/server/src/provider/AntigravityInstallation.test.ts b/apps/server/src/provider/AntigravityInstallation.test.ts index 60361fe94fa0e..a8a83bec9548f 100644 --- a/apps/server/src/provider/AntigravityInstallation.test.ts +++ b/apps/server/src/provider/AntigravityInstallation.test.ts @@ -577,56 +577,61 @@ it.layer(Layer.mergeAll(NodeServices.layer, NodeCrypto.layer))("Antigravity inst }), ); - it.effect("re-signs the Intel Mac runtime ad hoc and records the signed sizes", () => - Effect.gen(function* () { - const fs = yield* FileSystem.FileSystem; - const signed: Array> = []; - const spawner = ChildProcessSpawner.make((command) => - Effect.gen(function* () { - if (!ChildProcess.isStandardCommand(command)) - return yield* Effect.die("Unexpected spawn."); - const args = command.args.map(String); - signed.push([String(command.command), ...args]); - // codesign rewrites the signature, which changes each file's size. - for (const file of args.slice(3)) { - yield* fs.writeFileString(file, "signature", { flag: "a" }); - } - return ChildProcessSpawner.makeHandle({ - pid: ChildProcessSpawner.ProcessId(900_000_301), - exitCode: Effect.succeed(ChildProcessSpawner.ExitCode(0)), - isRunning: Effect.succeed(false), - kill: () => Effect.void, - unref: Effect.succeed(Effect.void), - stdin: Sink.drain, - stdout: Stream.empty, - stderr: Stream.empty, - all: Stream.empty, - getInputFd: () => Sink.drain, - getOutputFd: () => Stream.empty, - }); - }).pipe(Effect.orDie), - ); - const { installation, validations } = yield* makeHarness({ - platform: "darwin", - arch: "x64", - spawner, - }); - yield* installation.start; - expect((yield* terminalState(installation)).phase).toBe("succeeded"); - const validated = validations[0]?.executable; - expect(signed).toEqual([ - [ - "/usr/bin/codesign", - "--force", - "--sign", - "-", - validated?.executablePath, - validated?.harnessPath, - ], - ]); - const selected = yield* installation.resolve(); - expect(yield* fs.readFileString(selected.executablePath)).toBe(`${serverContents}signature`); - }), + // A simulated Mac install needs POSIX execute bits, which Windows files lack. + it.effect.skipIf(HostProcess.Platform.defaultValue() === "win32")( + "re-signs the Intel Mac runtime ad hoc and records the signed sizes", + () => + Effect.gen(function* () { + const fs = yield* FileSystem.FileSystem; + const signed: Array> = []; + const spawner = ChildProcessSpawner.make((command) => + Effect.gen(function* () { + if (!ChildProcess.isStandardCommand(command)) + return yield* Effect.die("Unexpected spawn."); + const args = command.args.map(String); + signed.push([String(command.command), ...args]); + // codesign rewrites the signature, which changes each file's size. + for (const file of args.slice(3)) { + yield* fs.writeFileString(file, "signature", { flag: "a" }); + } + return ChildProcessSpawner.makeHandle({ + pid: ChildProcessSpawner.ProcessId(900_000_301), + exitCode: Effect.succeed(ChildProcessSpawner.ExitCode(0)), + isRunning: Effect.succeed(false), + kill: () => Effect.void, + unref: Effect.succeed(Effect.void), + stdin: Sink.drain, + stdout: Stream.empty, + stderr: Stream.empty, + all: Stream.empty, + getInputFd: () => Sink.drain, + getOutputFd: () => Stream.empty, + }); + }).pipe(Effect.orDie), + ); + const { installation, validations } = yield* makeHarness({ + platform: "darwin", + arch: "x64", + spawner, + }); + yield* installation.start; + expect((yield* terminalState(installation)).phase).toBe("succeeded"); + const validated = validations[0]?.executable; + expect(signed).toEqual([ + [ + "/usr/bin/codesign", + "--force", + "--sign", + "-", + validated?.executablePath, + validated?.harnessPath, + ], + ]); + const selected = yield* installation.resolve(); + expect(yield* fs.readFileString(selected.executablePath)).toBe( + `${serverContents}signature`, + ); + }), ); // The mocked Linux PATH walk needs POSIX paths; Windows temp paths contain colons.