authorgravatar for alex.vostres@gmail.comAlexander Vostres <alex.vostres@gmail.com> 2026-03-28 19:26:13+02:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2026-03-28 10:26:13-07:00
logd2e6c82709230e8b2772cee2640d36d9b745274e
tree33f2454abb16db642ce013e20812795a92f7d440
parent23b3f0c3d0a7de1ca860db03a9b8cacec6f2f7f6
signature Signed by PGP key B5690EEEBB952194

Skip a unit test that is using a bash script on Windows (#1490)


1 files changed, 52 insertions(+), 50 deletions(-)

apps/server/src/provider/Layers/ProviderRegistry.test.ts+52-50
......@@ -186,58 +186,60 @@ it.layer(Layer.mergeAll(NodeServices.layer, ServerSettingsService.layerTest()))(
186186 ),
187187 );
188188
189 it.effect("inherits PATH when launching the codex probe with a CODEX_HOME override", () =>
190 Effect.gen(function* () {
191 const fileSystem = yield* FileSystem.FileSystem;
192 const path = yield* Path.Path;
193 const binDir = yield* fileSystem.makeTempDirectoryScoped({
194 prefix: "t3-test-codex-bin-",
195 });
196 const codexPath = path.join(binDir, "codex");
197 yield* fileSystem.writeFileString(
198 codexPath,
199 [
200 "#!/bin/sh",
201 'if [ "$1" = "--version" ]; then',
202 ' echo "codex-cli 1.0.0"',
203 " exit 0",
204 "fi",
205 'if [ "$1" = "login" ] && [ "$2" = "status" ]; then',
206 ' echo "Logged in using ChatGPT"',
207 " exit 0",
208 "fi",
209 'echo "unexpected args: $*" >&2',
210 "exit 1",
211 "",
212 ].join("\n"),
213 );
214 yield* fileSystem.chmod(codexPath, 0o755);
215 const customCodexHome = yield* fileSystem.makeTempDirectoryScoped({
216 prefix: "t3-test-codex-home-",
217 });
218 const previousPath = process.env.PATH;
219 process.env.PATH = binDir;
220
221 try {
222 const serverSettingsLayer = ServerSettingsService.layerTest({
223 providers: {
224 codex: {
225 homePath: customCodexHome,
226 },
227 },
189 it.effect.skipIf(process.platform === "win32")(
190 "inherits PATH when launching the codex probe with a CODEX_HOME override",
191 () =>
192 Effect.gen(function* () {
193 const fileSystem = yield* FileSystem.FileSystem;
194 const path = yield* Path.Path;
195 const binDir = yield* fileSystem.makeTempDirectoryScoped({
196 prefix: "t3-test-codex-bin-",
228197 });
229
230 const status = yield* checkCodexProviderStatus().pipe(
231 Effect.provide(serverSettingsLayer),
198 const codexPath = path.join(binDir, "codex");
199 yield* fileSystem.writeFileString(
200 codexPath,
201 [
202 "#!/bin/sh",
203 'if [ "$1" = "--version" ]; then',
204 ' echo "codex-cli 1.0.0"',
205 " exit 0",
206 "fi",
207 'if [ "$1" = "login" ] && [ "$2" = "status" ]; then',
208 ' echo "Logged in using ChatGPT"',
209 " exit 0",
210 "fi",
211 'echo "unexpected args: $*" >&2',
212 "exit 1",
213 "",
214 ].join("\n"),
232215 );
233 assert.strictEqual(status.provider, "codex");
234 assert.strictEqual(status.installed, true);
235 assert.strictEqual(status.status, "ready");
236 assert.strictEqual(status.authStatus, "authenticated");
237 } finally {
238 process.env.PATH = previousPath;
239 }
240 }),
216 yield* fileSystem.chmod(codexPath, 0o755);
217 const customCodexHome = yield* fileSystem.makeTempDirectoryScoped({
218 prefix: "t3-test-codex-home-",
219 });
220 const previousPath = process.env.PATH;
221 process.env.PATH = binDir;
222
223 try {
224 const serverSettingsLayer = ServerSettingsService.layerTest({
225 providers: {
226 codex: {
227 homePath: customCodexHome,
228 },
229 },
230 });
231
232 const status = yield* checkCodexProviderStatus().pipe(
233 Effect.provide(serverSettingsLayer),
234 );
235 assert.strictEqual(status.provider, "codex");
236 assert.strictEqual(status.installed, true);
237 assert.strictEqual(status.status, "ready");
238 assert.strictEqual(status.authStatus, "authenticated");
239 } finally {
240 process.env.PATH = previousPath;
241 }
242 }),
241243 );
242244
243245 it.effect("returns unavailable when codex is missing", () =>