From 290ce99226101ee19ee70b1ab1bb3b8fd98aaadb 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 c7a3675..e9754a7 100644 --- a/cmd/review-bot/main_test.go +++ b/cmd/review-bot/main_test.go @@ -1527,6 +1527,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(), @@ -1564,6 +1566,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(),