Skip to content

Commit 37bfe27

Browse files
authored
Test Integration: hardcode binary tmp for darwin (dapr#7664)
On Darwin (MacOS), `os.TempDir()` nicely returns a truly ephemeral process directory is `/var/folders/...` however in order to reap the benefits of Go cache magic in integration tests we need a slightly more permanent directory, i.e. `/tmp`. This directory will persist across integration test runs and speed up the test execution boot times from s to ms. Signed-off-by: joshvanl <[email protected]>
1 parent 892acfb commit 37bfe27

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

tests/integration/framework/binary/binary.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,13 @@ func Build(t *testing.T, name string) {
6060

6161
// Use a consistent temp dir for the binary so that the binary is cached on
6262
// subsequent runs.
63-
binPath := filepath.Join(os.TempDir(), "dapr_integration_tests/"+name)
63+
var tmpdir string
64+
if runtime.GOOS == "darwin" {
65+
tmpdir = "/tmp"
66+
} else {
67+
tmpdir = os.TempDir()
68+
}
69+
binPath := filepath.Join(tmpdir, "dapr_integration_tests/"+name)
6470
if runtime.GOOS == "windows" {
6571
binPath += ".exe"
6672
}

0 commit comments

Comments
 (0)