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(),