Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(cli): t3 service restart no longer calls an installed service not installed #45014

Mergedshivamhwp(GitHub profile, opens in a new tab)merged 2 commits intomain fromrefs/pull/45014/headmerged by juliusmarminge View on GitHub

Showing 2 changed files with 35 additions and 2 deletions.

x
0 of 2 viewed, 2 left
32 additions and 1 deletionapps/server/src/cli/service.test.tsModified
View file
@@ -29,7 +29,7 @@
​
function makeTestService(
serviceStatus: BootService.BootServiceStatus,
- restartOutcome: "restarted" | "queued" = "restarted",
+ restartOutcome: "restarted" | "queued" | "skipped" = "restarted",
) {
const installOptions: Array<Parameters<BootService.BootService["Service"]["install"]>[0]> = [];
const restarts: Array<true> = [];
@@ -159,6 +159,37 @@
}),
​
+ it.effect("restart says a service whose home it cannot determine was not restarted", () =>
+ Effect.gen(function* () {
+ const fs = yield* FileSystem.FileSystem;
+ const baseDir = yield* fs.makeTempDirectoryScoped({ prefix: "t3-service-cli-test-" });
+ vi.spyOn(BootService, "layer").mockReturnValue(
+ Layer.succeed(
+ BootService.BootService,
+ makeTestService({ ...status, current: false }, "skipped").service,
+ ),
+ );
+​
+ const output = yield* Command.runWith(serviceCommand, { version: packageJson.version })([
+ "restart",
+ "--base-dir",
+ baseDir,
+ ]).pipe(