Commit b60e35c 1 parent 2496e94 commit b60e35c Copy full SHA for b60e35c
File tree 1 file changed +3
-14
lines changed
pkg/metricscollector/v1beta1/file-metricscollector
1 file changed +3
-14
lines changed Original file line number Diff line number Diff line change @@ -42,7 +42,8 @@ const (
42
42
)
43
43
44
44
var (
45
- testJsonDataPath = filepath .Join ("testdata" , "JSON" )
45
+ testDir = "testdata"
46
+ testJsonDataPath = filepath .Join (testDir , "JSON" )
46
47
testTextDataPath = filepath .Join ("testdata" , "TEXT" )
47
48
)
48
49
@@ -56,7 +57,7 @@ func TestCollectObservationLog(t *testing.T) {
56
57
if err := generateTEXTTestFiles (); err != nil {
57
58
t .Fatal (err )
58
59
}
59
- defer deleteTestDirs ( )
60
+ defer os . RemoveAll ( testDir )
60
61
61
62
testCases := map [string ]struct {
62
63
filePath string
@@ -337,18 +338,6 @@ func generateTestDirs() error {
337
338
return nil
338
339
}
339
340
340
- func deleteTestDirs () error {
341
- if err := os .RemoveAll (filepath .Dir (testJsonDataPath )); err != nil {
342
- return err
343
- }
344
-
345
- if err := os .RemoveAll (filepath .Dir (testTextDataPath )); err != nil {
346
- return err
347
- }
348
-
349
- return nil
350
- }
351
-
352
341
func generateJSONTestFiles () error {
353
342
testData := []struct {
354
343
fileName string
You can’t perform that action at this time.
0 commit comments