Skip to content

Commit 1fdc13f

Browse files
MikaMcFlurryclaude
andcommitted
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 <[email protected]>
1 parent d5fc29f commit 1fdc13f

3 files changed

Lines changed: 57 additions & 52 deletions

File tree

‎apps/server/src/orchestration-v2/Adapters/AntigravityAdapterV2.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,7 @@ describe("AntigravityAdapterV2 workspace changes", () => {
540540
},
541541
],
542542
);
543-
assert.include(JSON.stringify(sent.prompt), documentPath);
543+
assert.include(JSON.stringify(sent.prompt), JSON.stringify(documentPath).slice(1, -1));
544544
if (readTextFile === undefined) {
545545
return yield* Effect.die("Antigravity sessions must serve client file requests");
546546
}

‎apps/server/src/orchestration-v2/ThreadMessageIntake.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ it.effect("claims question uploads and passes readable paths through the V2 requ
135135
expect(NodeFS.readFileSync(path!)).toEqual(Buffer.from([1, 2, 3]));
136136
expect(command.answers?.q).toEqual([
137137
"Selected option",
138-
`Attached image "screen.png": "${path}"`,
138+
`Attached image "screen.png": ${JSON.stringify(path)}`,
139139
]);
140140
}).pipe(Effect.provide(layerIntakeTest)),
141141
);

‎apps/server/src/provider/AntigravityInstallation.test.ts‎

Lines changed: 55 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -577,56 +577,61 @@ it.layer(Layer.mergeAll(NodeServices.layer, NodeCrypto.layer))("Antigravity inst
577577
}),
578578
);
579579

580-
it.effect("re-signs the Intel Mac runtime ad hoc and records the signed sizes", () =>
581-
Effect.gen(function* () {
582-
const fs = yield* FileSystem.FileSystem;
583-
const signed: Array<ReadonlyArray<string>> = [];
584-
const spawner = ChildProcessSpawner.make((command) =>
585-
Effect.gen(function* () {
586-
if (!ChildProcess.isStandardCommand(command))
587-
return yield* Effect.die("Unexpected spawn.");
588-
const args = command.args.map(String);
589-
signed.push([String(command.command), ...args]);
590-
// codesign rewrites the signature, which changes each file's size.
591-
for (const file of args.slice(3)) {
592-
yield* fs.writeFileString(file, "signature", { flag: "a" });
593-
}
594-
return ChildProcessSpawner.makeHandle({
595-
pid: ChildProcessSpawner.ProcessId(900_000_301),
596-
exitCode: Effect.succeed(ChildProcessSpawner.ExitCode(0)),
597-
isRunning: Effect.succeed(false),
598-
kill: () => Effect.void,
599-
unref: Effect.succeed(Effect.void),
600-
stdin: Sink.drain,
601-
stdout: Stream.empty,
602-
stderr: Stream.empty,
603-
all: Stream.empty,
604-
getInputFd: () => Sink.drain,
605-
getOutputFd: () => Stream.empty,
606-
});
607-
}).pipe(Effect.orDie),
608-
);
609-
const { installation, validations } = yield* makeHarness({
610-
platform: "darwin",
611-
arch: "x64",
612-
spawner,
613-
});
614-
yield* installation.start;
615-
expect((yield* terminalState(installation)).phase).toBe("succeeded");
616-
const validated = validations[0]?.executable;
617-
expect(signed).toEqual([
618-
[
619-
"/usr/bin/codesign",
620-
"--force",
621-
"--sign",
622-
"-",
623-
validated?.executablePath,
624-
validated?.harnessPath,
625-
],
626-
]);
627-
const selected = yield* installation.resolve();
628-
expect(yield* fs.readFileString(selected.executablePath)).toBe(`${serverContents}signature`);
629-
}),
580+
// A simulated Mac install needs POSIX execute bits, which Windows files lack.
581+
it.effect.skipIf(HostProcess.Platform.defaultValue() === "win32")(
582+
"re-signs the Intel Mac runtime ad hoc and records the signed sizes",
583+
() =>
584+
Effect.gen(function* () {
585+
const fs = yield* FileSystem.FileSystem;
586+
const signed: Array<ReadonlyArray<string>> = [];
587+
const spawner = ChildProcessSpawner.make((command) =>
588+
Effect.gen(function* () {
589+
if (!ChildProcess.isStandardCommand(command))
590+
return yield* Effect.die("Unexpected spawn.");
591+
const args = command.args.map(String);
592+
signed.push([String(command.command), ...args]);
593+
// codesign rewrites the signature, which changes each file's size.
594+
for (const file of args.slice(3)) {
595+
yield* fs.writeFileString(file, "signature", { flag: "a" });
596+
}
597+
return ChildProcessSpawner.makeHandle({
598+
pid: ChildProcessSpawner.ProcessId(900_000_301),
599+
exitCode: Effect.succeed(ChildProcessSpawner.ExitCode(0)),
600+
isRunning: Effect.succeed(false),
601+
kill: () => Effect.void,
602+
unref: Effect.succeed(Effect.void),
603+
stdin: Sink.drain,
604+
stdout: Stream.empty,
605+
stderr: Stream.empty,
606+
all: Stream.empty,
607+
getInputFd: () => Sink.drain,
608+
getOutputFd: () => Stream.empty,
609+
});
610+
}).pipe(Effect.orDie),
611+
);
612+
const { installation, validations } = yield* makeHarness({
613+
platform: "darwin",
614+
arch: "x64",
615+
spawner,
616+
});
617+
yield* installation.start;
618+
expect((yield* terminalState(installation)).phase).toBe("succeeded");
619+
const validated = validations[0]?.executable;
620+
expect(signed).toEqual([
621+
[
622+
"/usr/bin/codesign",
623+
"--force",
624+
"--sign",
625+
"-",
626+
validated?.executablePath,
627+
validated?.harnessPath,
628+
],
629+
]);
630+
const selected = yield* installation.resolve();
631+
expect(yield* fs.readFileString(selected.executablePath)).toBe(
632+
`${serverContents}signature`,
633+
);
634+
}),
630635
);
631636

632637
// The mocked Linux PATH walk needs POSIX paths; Windows temp paths contain colons.

0 commit comments

Comments
 (0)