From 430e61fdbd0b12b87d6895887acdc91bf133c9c0 Mon Sep 17 00:00:00 2001 From: Rodin Date: Fri, 15 May 2026 11:59:25 +0000 Subject: [PATCH] test(#146): clarify t.TempDir() evaluation in subprocess env setup --- cmd/review-bot/main_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmd/review-bot/main_test.go b/cmd/review-bot/main_test.go index 6b8d75b..e9d32c8 100644 --- a/cmd/review-bot/main_test.go +++ b/cmd/review-bot/main_test.go @@ -1521,6 +1521,8 @@ func TestMainSubprocess_InvalidDocMapPath(t *testing.T) { } cmd := exec.Command(os.Args[0], "-test.run=TestMainSubprocess_InvalidDocMapPath") + // t.TempDir() is evaluated here in the outer process, producing a real directory + // that is passed as the GITHUB_WORKSPACE env var string to the subprocess. cmd.Env = append(cleanEnv(), "TEST_SUBPROCESS_MAIN=1", "GITHUB_WORKSPACE="+t.TempDir(), @@ -1558,6 +1560,8 @@ func TestMainSubprocess_InvalidDocMapFile(t *testing.T) { } cmd := exec.Command(os.Args[0], "-test.run=TestMainSubprocess_InvalidDocMapFile") + // t.TempDir() is evaluated here in the outer process, producing a real directory + // that is passed as the GITHUB_WORKSPACE env var string to the subprocess. cmd.Env = append(cleanEnv(), "TEST_SUBPROCESS_MAIN=1", "GITHUB_WORKSPACE="+t.TempDir(),