authorgravatar for yordis.prieto@gmail.comYordis Prieto <yordis.prieto@gmail.com> 2026-10-04 00:47:55-04:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2026-10-03 21:47:55-07:00
log070127cbb7b4a0a44bab760f59b51829ec349528
treebad2836936e8bfe2fc9051d98ada1b33422f1072
parent845ddd9354538d42db1cc7dc30143c6bb8f0d40f
signature Signed by PGP key B5690EEEBB952194

test(server): the git-ssh wrapper's fake SSH script is a fixture file, not a generated string (#15480)

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

2 files changed, 10 insertions(+), 15 deletions(-)

apps/server/src/vcs/GitVcsDriverCore.test.ts+3-15
......@@ -2216,7 +2216,9 @@ it.layer(TestLayer)("GitVcsDriver core integration", (it) => {
22162216 const fileSystem = yield* FileSystem.FileSystem;
22172217 const pathService = yield* Path.Path;
22182218 const sshLogPath = pathService.join(tempDir, "ssh-env.txt");
2219 const sshWrapperPath = pathService.join(tempDir, "ssh-wrapper.sh");
2219 const sshWrapperPath = yield* pathService.fromFileUrl(
2220 new URL("./testing/GitVcsDriverCore.fixture.sh", import.meta.url),
2221 );
22202222 const envKeys = [
22212223 "GCM_INTERACTIVE",
22222224 "GIT_ASKPASS",
......@@ -2228,20 +2230,6 @@ it.layer(TestLayer)("GitVcsDriver core integration", (it) => {
22282230 ] as const;
22292231 const previousEnv = new Map(envKeys.map((key) => [key, process.env[key]]));
22302232
2231 yield* fileSystem.writeFileString(
2232 sshWrapperPath,
2233 [
2234 "#!/bin/sh",
2235 'printf "GCM_INTERACTIVE=%s\\n" "${GCM_INTERACTIVE:-}" > "$T3_TEST_SSH_ASKPASS_LOG"',
2236 'printf "GIT_ASKPASS=%s\\n" "${GIT_ASKPASS:-}" >> "$T3_TEST_SSH_ASKPASS_LOG"',
2237 'printf "GIT_TERMINAL_PROMPT=%s\\n" "${GIT_TERMINAL_PROMPT:-}" >> "$T3_TEST_SSH_ASKPASS_LOG"',
2238 'printf "SSH_ASKPASS=%s\\n" "${SSH_ASKPASS:-}" >> "$T3_TEST_SSH_ASKPASS_LOG"',
2239 'printf "SSH_ASKPASS_REQUIRE=%s\\n" "${SSH_ASKPASS_REQUIRE:-}" >> "$T3_TEST_SSH_ASKPASS_LOG"',
2240 "exit 1",
2241 "",
2242 ].join("\n"),
2243 );
2244 yield* fileSystem.chmod(sshWrapperPath, 0o755);
22452233 yield* git(cwd, ["remote", "add", "origin", "ssh://example.invalid/repo.git"]);
22462234 yield* git(cwd, ["update-ref", `refs/remotes/origin/${initialBranch}`, "HEAD"]);
22472235 yield* git(cwd, ["branch", "--set-upstream-to", `origin/${initialBranch}`]);
apps/server/src/vcs/testing/GitVcsDriverCore.fixture.sh created+7
......@@ -0,0 +1,7 @@
1#!/bin/sh
2printf "GCM_INTERACTIVE=%s\n" "${GCM_INTERACTIVE:-}" > "$T3_TEST_SSH_ASKPASS_LOG"
3printf "GIT_ASKPASS=%s\n" "${GIT_ASKPASS:-}" >> "$T3_TEST_SSH_ASKPASS_LOG"
4printf "GIT_TERMINAL_PROMPT=%s\n" "${GIT_TERMINAL_PROMPT:-}" >> "$T3_TEST_SSH_ASKPASS_LOG"
5printf "SSH_ASKPASS=%s\n" "${SSH_ASKPASS:-}" >> "$T3_TEST_SSH_ASKPASS_LOG"
6printf "SSH_ASKPASS_REQUIRE=%s\n" "${SSH_ASKPASS_REQUIRE:-}" >> "$T3_TEST_SSH_ASKPASS_LOG"
7exit 1