Skip to content

Commit 1c41dc5

Browse files
committed
Copy TEST_TMPDIR env variable to TMPDIR before running tests
1 parent bcbc7e9 commit 1c41dc5

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

go/tools/builders/generate_test_main.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,13 @@ func main() {
178178
// out of the Chdir behavior.
179179
_ = os.Unsetenv("GO_TEST_RUN_FROM_BAZEL")
180180
181+
// NOTE(ricky): Bazel sets the TEST_TMPDIR env variable, but Cockroach
182+
// tests generally consult TMPDIR.
183+
err := os.Setenv("TMPDIR", os.Getenv("TEST_TMPDIR"))
184+
if err != nil {
185+
panic(err)
186+
}
187+
181188
if bzltestutil.ShouldWrap() {
182189
err := bzltestutil.Wrap("{{.Pkgname}}")
183190
exitCode := 0

0 commit comments

Comments
 (0)