Skip to content

Commit 4aaf264

Browse files
committed
test(ssh): align pairing fixtures with current Effect services
1 parent 34167c8 commit 4aaf264

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

‎packages/ssh/src/tunnel.test.ts‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { assert, describe, it } from "@effect/vitest";
44
import * as NodeCrypto from "@effect/platform-node/NodeCrypto";
55
import * as NodeServices from "@effect/platform-node/NodeServices";
66
import * as NetService from "@t3tools/shared/Net";
7+
import * as Config from "effect/Config";
78
import * as Deferred from "effect/Deferred";
89
import * as Duration from "effect/Duration";
910
import * as Effect from "effect/Effect";
@@ -178,6 +179,7 @@ describe("ssh tunnel scripts", () => {
178179
const credential = mode === "archive" ? `paired-${serverVersion}` : "paired-dev";
179180
const fs = yield* FileSystem.FileSystem;
180181
const localSpawner = yield* ChildProcessSpawner.ChildProcessSpawner;
182+
const path = yield* Config.String("PATH").pipe(Config.withDefault(""));
181183
const home = yield* fs.makeTempDirectoryScoped({ prefix: "t3-ssh-pairing-" });
182184
for (const version of [serverVersion, ARCHIVE.archiveVersion]) {
183185
const runtime = `${home}/.t3/runtime/versions/${version}`;
@@ -229,7 +231,7 @@ describe("ssh tunnel scripts", () => {
229231
if (script.includes("PAIRING_BASE_DIR=")) {
230232
return yield* localSpawner.spawn(
231233
ChildProcess.make("sh", ["-s"], {
232-
env: { HOME: home, PATH: process.env.PATH ?? "" },
234+
env: { HOME: home, PATH: path },
233235
stdin: {
234236
stream: Stream.make(new TextEncoder().encode(script)),
235237
endOnDone: true,
@@ -278,7 +280,10 @@ describe("ssh tunnel scripts", () => {
278280
),
279281
Effect.scoped,
280282
);
281-
}).pipe(Effect.provide(NodeServices.layer), Effect.scoped),
283+
}).pipe(
284+
Effect.provide(Layer.mergeAll(NodeServices.layer, NodeCrypto.layer)),
285+
Effect.scoped,
286+
),
282287
);
283288
});
284289

@@ -338,6 +343,7 @@ describe("ssh tunnel scripts", () => {
338343
Effect.provide(
339344
Layer.mergeAll(
340345
NodeServices.layer,
346+
NodeCrypto.layer,
341347
Layer.succeed(ChildProcessSpawner.ChildProcessSpawner, spawner),
342348
Layer.succeed(HttpClient.HttpClient, testHttpClient),
343349
Layer.succeed(NetService.NetService, testNetService),

0 commit comments

Comments
 (0)