Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(ssh): exec managed servers without npm wrappers #9843

Mergedjuliusmarmingemerged 1 commit intomain fromrefs/pull/9843/headmerged by juliusmarminge View on GitHub

Showing 3 changed files with 171 additions and 6 deletions.

x
0 of 3 viewed, 3 left
167 additions and 0 deletionspackages/ssh/src/runnerProcess.test.tsAdded
View file
@@ -0,0 +1,167 @@
+import * as NodeServices from "@effect/platform-node/NodeServices";
+import { assert, describe, it } from "@effect/vitest";
+import { HostProcessPlatform } from "@t3tools/shared/hostProcess";
+import * as Deferred from "effect/Deferred";
+import * as Effect from "effect/Effect";
+import * as Fiber from "effect/Fiber";
+import * as FileSystem from "effect/FileSystem";
+import * as Path from "effect/Path";
+import * as Schema from "effect/Schema";
+import * as Stream from "effect/Stream";
+import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process";
+import * as NodeNet from "node:net";
+​
+import { buildRemoteT3RunnerScript } from "./tunnel.ts";
+​
+const Started = Schema.Struct({
+ pid: Schema.Number,
+ port: Schema.Number,
+ args: Schema.Array(Schema.String),
+});
+const decodeStarted = Schema.decodeUnknownSync(Schema.fromJsonString(Started));
+​
+describe.skipIf(HostProcessPlatform.defaultValue() === "win32")(
+ "remote runner process ownership",
+ () => {
+ it.live.each(["npx", "npm"] as const)(
+ "keeps the server PID and graceful shutdown through the %s fallback",
+ (packageManager) =>
+ Effect.gen(function* () {
+ const fs = yield* FileSystem.FileSystem;