Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(cli): t3 update no longer says a service awaiting restart runs the new version #29901

Mergedsaphid(GitHub profile, opens in a new tab)merged 2 commits intomain fromrefs/pull/29901/headmerged by maria-rcks View on GitHub

Showing 2 changed files with 104 additions and 2 deletions.

x
0 of 2 viewed, 2 left
96 additions and 1 deletionapps/server/src/cli/update.test.tsModified
View file
@@ -10,12 +10,14 @@
import * as Option from "effect/Option";
import * as Path from "effect/Path";
import * as TestClock from "effect/testing/TestClock";
+import * as TestConsole from "effect/testing/TestConsole";
import { HttpClient, HttpClientResponse } from "effect/http";
import * as ChildProcessSpawner from "effect/process/ChildProcessSpawner";
import { afterEach, vi } from "vite-plus/test";
​
+import packageJson from "../../package.json" with { type: "json" };
import * as BootService from "../cloud/bootService.ts";
-import { prunePinnedRuntimes } from "../cloud/pinnedRuntime.ts";
+import { pinnedRuntimePaths, prunePinnedRuntimes } from "../cloud/pinnedRuntime.ts";
import * as ManagedPolicy from "../policy/ManagedPolicy.ts";
import * as ProcessRunner from "../processRunner.ts";
import { repointLauncher, resolveLauncherPath, resolveNewestVersion, runUpdate } from "./update.ts";
@@ -364,3 +366,96 @@
}).pipe(Effect.scoped, Effect.provideService(HostProcess.Platform, "linux")),
});
+​
+// Without terminals, update skips its restart prompt whatever runs the test.
+const withoutTerminals = Effect.acquireRelease(
+ Effect.sync(() =>
+ [process.stdin, process.stdout].map((stream) => {
+ const descriptor = Object.getOwnPropertyDescriptor(stream, "isTTY");
+ Object.defineProperty(stream, "isTTY", { configurable: true, value: false });
+ return { stream, descriptor };
+ }),