Skip to content

Commit 61ccc10

Browse files
t3dotggclaude
andcommitted
test(server): cover launcher args falling through to the full CLI
Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 1f4e5e4 commit 61ccc10

3 files changed

Lines changed: 10 additions & 5 deletions

File tree

‎apps/server/src/bin.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ if (
4343
})
4444
) {
4545
// The launcher owns shutdown until its child exits, so it bypasses the Effect CLI runtime.
46-
// The service unit passes no arguments; anything else reaches the CLI's usage error.
46+
// The service unit passes no arguments; anything else goes to the full CLI.
4747
if (process.argv[2] === "__service-launcher" && process.argv.length === 3) {
4848
const { runServiceLauncherCli } = await import("./cli/serviceLauncher.ts");
4949
await runServiceLauncherCli();

‎apps/server/src/cliCompileCache.test.ts‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ it.live("loads the CLI with its cache settings only when the command needs it",
2222
`;
2323
const run = Effect.fn("cliCompileCache.test.run")(function* (
2424
env: Record<string, string>,
25-
command = "--help",
25+
args: ReadonlyArray<string> = ["--help"],
2626
) {
2727
const child = yield* spawner.spawn(
2828
ChildProcess.make(
@@ -32,7 +32,7 @@ it.live("loads the CLI with its cache settings only when the command needs it",
3232
"--import",
3333
`data:text/javascript,${encodeURIComponent(report)}`,
3434
NodeURL.fileURLToPath(new URL("./bin.ts", import.meta.url)),
35-
command,
35+
...args,
3636
],
3737
{
3838
env: {
@@ -61,10 +61,13 @@ it.live("loads the CLI with its cache settings only when the command needs it",
6161
expect(normal.stderr.replaceAll("\\", "/")).toContain(
6262
`CACHE=${root}/cache/t3code/compile-cache`.replaceAll("\\", "/"),
6363
);
64-
const launcher = yield* run({ T3CODE_HOME: "" }, "__service-launcher");
64+
const launcher = yield* run({ T3CODE_HOME: "" }, ["__service-launcher"]);
6565
expect(launcher.exitCode).toBe(1);
6666
expect(launcher.stderr).toContain("[service-launcher] T3CODE_HOME is required");
6767
expect(launcher.stderr).not.toMatch(/LOADED_CLI_MAIN|CACHE=/);
68+
const launcherHelp = yield* run({ T3CODE_HOME: "" }, ["__service-launcher", "--help"]);
69+
expect(launcherHelp.exitCode).toBe(0);
70+
expect(launcherHelp.stderr).toContain("LOADED_CLI_MAIN");
6871
const appImage = yield* run({ APPIMAGE: `${root}/T3Code.AppImage` });
6972
expect(appImage.exitCode).toBe(0);
7073
expect(appImage.stderr).toContain("CACHE=disabled");

‎scripts/smoke-cli-archive.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,9 @@ const smokeCliArchive = Effect.fn("smokeCliArchive")(function* (input: {
200200
detail: `no 200 from / within 30s\n${stdout}${stderr}`,
201201
});
202202
}
203-
yield* Effect.log(`[cli-smoke] ${root}: --version passed and serve answered on ${String(port)}.`);
203+
yield* Effect.log(
204+
`[cli-smoke] ${root}: --version and __service-launcher passed, and serve answered on ${String(port)}.`,
205+
);
204206
});
205207

206208
const command = Command.make(

0 commit comments

Comments
 (0)