TypeScript
test(server): three more tests stop assuming a POSIX host (#32263)
Mika Hertlerd5c2c12c4864
diff --git a/apps/server/src/orchestration-v2/Adapters/AntigravityAdapterV2.test.ts b/apps/server/src/orchestration-v2/Adapters/AntigravityAdapterV2.test.tsindex 6a9a9b01c5a..0945a282cee 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.tsindex ead417400e1..bec9c60c7a0 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 requexpect(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.tsindex 60361fe94fa..a8a83bec954 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<ReadonlyArray<string>> = [];- 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<ReadonlyArray<string>> = [];+ 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.