Adding small test update for temp dir using t.TempDir#13293
Adding small test update for temp dir using t.TempDir#13293jesusvazquez merged 2 commits intoprometheus:mainfrom
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.
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.
@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
jesusvazquez
left a comment
There was a problem hiding this comment.
LGTM Thank you for your contribution
| }) | ||
|
|
||
| tmpdir := t.TempDir() | ||
|
|
There was a problem hiding this comment.
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.