authorgravatar for yordis.prieto@gmail.comYordis Prieto <yordis.prieto@gmail.com> 2026-10-04 00:51:44-04:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2026-10-03 21:51:44-07:00
log1508552a16edebe29cab4820c54c16b75c142408
tree92fbac278c19d7ab97cf7f5d9a4e3643071c102a
parent070127cbb7b4a0a44bab760f59b51829ec349528
signature Signed by PGP key B5690EEEBB952194

test(server): the ACP registry's fake npm is a fixture file, not a generated string (#15483)

Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>

2 files changed, 25 insertions(+), 25 deletions(-)

apps/server/src/provider/acp/AcpRegistrySupport.test.ts+4-25
...@@ -78,32 +78,11 @@ const makeFakeNpmToolchain = Effect.fn("AcpRegistrySupport.test.makeFakeNpmToolc...@@ -78,32 +78,11 @@ const makeFakeNpmToolchain = Effect.fn("AcpRegistrySupport.test.makeFakeNpmToolc
78 yield* fileSystem.makeDirectory(toolchainBin, { recursive: true });78 yield* fileSystem.makeDirectory(toolchainBin, { recursive: true });
79 yield* fileSystem.makeDirectory(globalPrefix, { recursive: true });79 yield* fileSystem.makeDirectory(globalPrefix, { recursive: true });
80 yield* fileSystem.writeFileString(logPath, "");80 yield* fileSystem.writeFileString(logPath, "");
81 yield* fileSystem.writeFileString(81 yield* fileSystem.copyFile(
82 yield* path.fromFileUrl(
83 new URL("./testing/AcpRegistrySupport.npm.fixture.sh", import.meta.url),
84 ),
82 npmPath,85 npmPath,
83 [
84 "#!/bin/sh",
85 'printf \'%s\\n\' "$*" >> "$FAKE_NPM_LOG"',
86 'prefix="${npm_config_prefix:-$FAKE_NPM_PREFIX}"',
87 'if [ "$1" = "root" ] && [ "$2" = "--global" ]; then',
88 " printf '%s\\n' \"$prefix/lib/node_modules\"",
89 " exit 0",
90 "fi",
91 'if [ "$1" = "prefix" ] && [ "$2" = "--global" ]; then',
92 " printf '%s\\n' \"$prefix\"",
93 " exit 0",
94 "fi",
95 'if [ "$1" = "install" ] && [ "$2" = "--global" ]; then',
96 ' package_root="$prefix/lib/node_modules/@example/acp"',
97 ' executable="$prefix/bin/example-agent"',
98 ' mkdir -p "$package_root" "$prefix/bin"',
99 ' printf \'%s\' "$FAKE_NPM_MANIFEST" > "$package_root/package.json"',
100 " printf '#!/bin/sh\\n' > \"$executable\"",
101 ' chmod 755 "$executable"',
102 " exit 0",
103 "fi",
104 "exit 64",
105 "",
106 ].join("\n"),
107 );86 );
108 yield* fileSystem.chmod(npmPath, 0o755);87 yield* fileSystem.chmod(npmPath, 0o755);
109 return {88 return {
apps/server/src/provider/acp/testing/AcpRegistrySupport.npm.fixture.sh created+21
...@@ -0,0 +1,21 @@
1#!/bin/sh
2printf '%s\n' "$*" >> "$FAKE_NPM_LOG"
3prefix="${npm_config_prefix:-$FAKE_NPM_PREFIX}"
4if [ "$1" = "root" ] && [ "$2" = "--global" ]; then
5 printf '%s\n' "$prefix/lib/node_modules"
6 exit 0
7fi
8if [ "$1" = "prefix" ] && [ "$2" = "--global" ]; then
9 printf '%s\n' "$prefix"
10 exit 0
11fi
12if [ "$1" = "install" ] && [ "$2" = "--global" ]; then
13 package_root="$prefix/lib/node_modules/@example/acp"
14 executable="$prefix/bin/example-agent"
15 mkdir -p "$package_root" "$prefix/bin"
16 printf '%s' "$FAKE_NPM_MANIFEST" > "$package_root/package.json"
17 printf '#!/bin/sh\n' > "$executable"
18 chmod 755 "$executable"
19 exit 0
20fi
21exit 64