test(#146): add TestMainSubprocess_InvalidDocMapPath and TestMainSubprocess_InvalidDocMapFile #151
@@ -1521,6 +1521,8 @@ func TestMainSubprocess_InvalidDocMapPath(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
cmd := exec.Command(os.Args[0], "-test.run=TestMainSubprocess_InvalidDocMapPath")
|
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(),
|
cmd.Env = append(cleanEnv(),
|
||||||
"TEST_SUBPROCESS_MAIN=1",
|
"TEST_SUBPROCESS_MAIN=1",
|
||||||
"GITHUB_WORKSPACE="+t.TempDir(),
|
"GITHUB_WORKSPACE="+t.TempDir(),
|
||||||
|
|
|||||||
@@ -1558,6 +1560,8 @@ func TestMainSubprocess_InvalidDocMapFile(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
cmd := exec.Command(os.Args[0], "-test.run=TestMainSubprocess_InvalidDocMapFile")
|
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(),
|
cmd.Env = append(cleanEnv(),
|
||||||
"TEST_SUBPROCESS_MAIN=1",
|
"TEST_SUBPROCESS_MAIN=1",
|
||||||
"GITHUB_WORKSPACE="+t.TempDir(),
|
"GITHUB_WORKSPACE="+t.TempDir(),
|
||||||
|
|||||||
Reference in New Issue
Block a user
[NIT] The comment
// 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.is duplicated verbatim in both new test functions. It's accurate and useful, but could be a shared helper (e.g.workspaceEnv(t)) to avoid repeating the same comment+pattern four times total (two existing tests already use similar patterns). Minor — not worth blocking.