-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Adding small test update for temp dir using t.TempDir #13293
Adding small test update for temp dir using t.TempDir #13293
Conversation
Im also pinging @beorn7 , for review if possible |
promql/engine_test.go
Outdated
require.NoError(t, err) | ||
defer os.RemoveAll(dir) | ||
dir := t.TempDir() | ||
t.Cleanup(func() { |
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.
t.TempDir() TempDir returns a temporary directory for the test to use. The directory is automatically removed by Cleanup when the test and all its subtests complete.
t.Cleanup(func() { |
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.
@roidelapluie thank you for the explanation, all make sense, I will update pr
Signed-off-by: Mile Druzijanic <miledruz@gmail.com> Signed-off-by: Mile Druzijanic <zedsprogramms@gmail.com>
Signed-off-by: Mile Druzijanic <zedsprogramms@gmail.com>
1ffe445
to
1620867
Compare
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 Thank you for your contribution
}) | ||
|
||
tmpdir := t.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.
FYI this is a line consisting only of tabs, which fails current linting rules.
I think I will revert this change until we sort out what has gone wrong. |
This reverts commit 2ddb359. Various tests are failing in CI after this change; reverting to free up other work.
This reverts commit 2ddb359. Various tests are failing in CI after this change; reverting to free up other work. Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
Revert "Adding small test update for temp dir using t.TempDir (#13293)"
* Adding small test update for temp dir using t.TempDir Signed-off-by: Mile Druzijanic <miledruz@gmail.com> Signed-off-by: Mile Druzijanic <zedsprogramms@gmail.com> * removing not required cleanup Signed-off-by: Mile Druzijanic <zedsprogramms@gmail.com> --------- Signed-off-by: Mile Druzijanic <miledruz@gmail.com> Signed-off-by: Mile Druzijanic <zedsprogramms@gmail.com>
…heus#13293)" This reverts commit 2ddb359. Various tests are failing in CI after this change; reverting to free up other work. Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
This is a little fix update for this issue:
#9594
Use case. Why is this important?
Error handling is implicit.
Cleanup is implicit.