From ec4cf7df2732a720435f3178fac61c90634ab99a Mon Sep 17 00:00:00 2001 From: claude-hdb Date: Thu, 16 Jul 2026 18:14:20 +0000 Subject: [PATCH] fix(test): use /dev/fd instead of /proc/self/fd in fd-path regression test (#37) /proc does not exist on macOS, and cast runs on the operator's workstation. /dev/fd resolves on both platforms (on Linux it is a symlink to /proc/self/fd) and is closer to what bash expands <(...) to. Co-Authored-By: Claude Fable 5 --- test/secrets.test.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test/secrets.test.ts b/test/secrets.test.ts index 5dd2a0b..e6136cf 100644 --- a/test/secrets.test.ts +++ b/test/secrets.test.ts @@ -36,15 +36,16 @@ describe("decryptSecrets", () => { }); it("accepts a key path only this process can resolve — what <(pm read …) injects", () => { - // Process substitution hands cast a path like /proc/self/fd/11 that is + // Process substitution hands cast a path like /dev/fd/11 that is // meaningful only inside the process holding the fd. A spawned age does // not hold it, so passing the path through as `-i ` can never work; // the identity must travel to age on stdin. Opening the key here and - // pointing at our own fd reproduces exactly that shape. + // pointing at our own fd reproduces exactly that shape. /dev/fd works on + // both Linux (symlink to /proc/self/fd) and macOS, where /proc is absent. const { keyFile, enc } = ageFixture(); const fd = openSync(keyFile, "r"); try { - expect(decryptSecrets(enc, `/proc/self/fd/${fd}`)).toEqual({ + expect(decryptSecrets(enc, `/dev/fd/${fd}`)).toEqual({ MAILGUN_KEY: "mk-123", OPENROUTER_KEY: "or-456", });