Skip to content

Commit f870c41

Browse files
authored
test(server): the ACP registry's fake uv is a fixture file, not a generated string (#15484)
Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
1 parent 1508552 commit f870c41

2 files changed

Lines changed: 24 additions & 26 deletions

File tree

‎apps/server/src/provider/acp/AcpRegistrySupport.test.ts‎

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -116,33 +116,9 @@ const makeFakeUvToolchain = Effect.fn("AcpRegistrySupport.test.makeFakeUvToolcha
116116
const logPath = path.join(rootDirectory, "uv.log");
117117
yield* fileSystem.makeDirectory(toolchainBin, { recursive: true });
118118
yield* fileSystem.writeFileString(logPath, "");
119-
yield* fileSystem.writeFileString(
119+
yield* fileSystem.copyFile(
120+
yield* path.fromFileUrl(new URL("./testing/AcpRegistrySupport.uv.fixture.sh", import.meta.url)),
120121
uvPath,
121-
[
122-
"#!/bin/sh",
123-
'printf \'%s\\n\' "$*" >> "$FAKE_UV_LOG"',
124-
'tool_bin="${UV_TOOL_BIN_DIR:-$FAKE_UV_BIN}"',
125-
'executable="$tool_bin/fast-agent"',
126-
'printf "tool-dir=%s bin-dir=%s\\n" "$UV_TOOL_DIR" "$UV_TOOL_BIN_DIR" >> "$FAKE_UV_LOG"',
127-
'if [ "$1" = "tool" ] && [ "$2" = "dir" ] && [ "$3" = "--bin" ]; then',
128-
" printf '%s\\n' \"$tool_bin\"",
129-
" exit 0",
130-
"fi",
131-
'if [ "$1" = "tool" ] && [ "$2" = "list" ]; then',
132-
' if [ -x "$executable" ]; then',
133-
" printf 'fast-agent-acp v0.10.1\\n- fast-agent\\n'",
134-
" fi",
135-
" exit 0",
136-
"fi",
137-
'if [ "$1" = "tool" ] && [ "$2" = "install" ] && [ "$3" = "--force" ]; then',
138-
' mkdir -p "$tool_bin"',
139-
" printf '#!/bin/sh\\n' > \"$executable\"",
140-
' chmod 755 "$executable"',
141-
" exit 0",
142-
"fi",
143-
"exit 64",
144-
"",
145-
].join("\n"),
146122
);
147123
yield* fileSystem.chmod(uvPath, 0o755);
148124
return {
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/sh
2+
printf '%s\n' "$*" >> "$FAKE_UV_LOG"
3+
tool_bin="${UV_TOOL_BIN_DIR:-$FAKE_UV_BIN}"
4+
executable="$tool_bin/fast-agent"
5+
printf "tool-dir=%s bin-dir=%s\n" "$UV_TOOL_DIR" "$UV_TOOL_BIN_DIR" >> "$FAKE_UV_LOG"
6+
if [ "$1" = "tool" ] && [ "$2" = "dir" ] && [ "$3" = "--bin" ]; then
7+
printf '%s\n' "$tool_bin"
8+
exit 0
9+
fi
10+
if [ "$1" = "tool" ] && [ "$2" = "list" ]; then
11+
if [ -x "$executable" ]; then
12+
printf 'fast-agent-acp v0.10.1\n- fast-agent\n'
13+
fi
14+
exit 0
15+
fi
16+
if [ "$1" = "tool" ] && [ "$2" = "install" ] && [ "$3" = "--force" ]; then
17+
mkdir -p "$tool_bin"
18+
printf '#!/bin/sh\n' > "$executable"
19+
chmod 755 "$executable"
20+
exit 0
21+
fi
22+
exit 64

0 commit comments

Comments
 (0)