-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test Integration: hardcode binary tmp for darwin #7664
Test Integration: hardcode binary tmp for darwin #7664
Conversation
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 <me@joshvanl.dev>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #7664 +/- ##
==========================================
- Coverage 61.87% 61.84% -0.04%
==========================================
Files 245 245
Lines 22418 22418
==========================================
- Hits 13872 13865 -7
- Misses 7385 7391 +6
- Partials 1161 1162 +1 ☔ View full report in Codecov by Sentry. |
if runtime.GOOS == "darwin" { | ||
tmpdir = "/tmp" | ||
} else { | ||
tmpdir = os.TempDir() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it a design issue for Go os package? Maybe we can submit an issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually think Go is doing the more correct thing here as a sane default, however because we want a slightly more persistent target directory we need to divert from the default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
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 <me@joshvanl.dev> Signed-off-by: Cassandra Coyle <cassie@diagrid.io>
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 <me@joshvanl.dev> Signed-off-by: Elena Kolevska <elena@kolevska.com>
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 when re-building binaries between integration test runs 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.Updates integration test binary builder to use
/tmp
as the root dir when running on darwin.