Skip to content

Commit

Permalink
Test Integration: hardcode binary tmp for darwin (dapr#7664)
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
JoshVanL authored Apr 1, 2024
1 parent 892acfb commit 37bfe27
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tests/integration/framework/binary/binary.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,13 @@ func Build(t *testing.T, name string) {

// Use a consistent temp dir for the binary so that the binary is cached on
// subsequent runs.
binPath := filepath.Join(os.TempDir(), "dapr_integration_tests/"+name)
var tmpdir string
if runtime.GOOS == "darwin" {
tmpdir = "/tmp"
} else {
tmpdir = os.TempDir()
}
binPath := filepath.Join(tmpdir, "dapr_integration_tests/"+name)
if runtime.GOOS == "windows" {
binPath += ".exe"
}
Expand Down

0 comments on commit 37bfe27

Please sign in to comment.