File tree Expand file tree Collapse file tree 1 file changed +3
-14
lines changed
pkg/metricscollector/v1beta1/file-metricscollector Expand file tree Collapse file tree 1 file changed +3
-14
lines changed Original file line number Diff line number Diff line change @@ -42,7 +42,8 @@ const (
4242)
4343
4444var (
45- testJsonDataPath = filepath .Join ("testdata" , "JSON" )
45+ testDir = "testdata"
46+ testJsonDataPath = filepath .Join (testDir , "JSON" )
4647 testTextDataPath = filepath .Join ("testdata" , "TEXT" )
4748)
4849
@@ -56,7 +57,7 @@ func TestCollectObservationLog(t *testing.T) {
5657 if err := generateTEXTTestFiles (); err != nil {
5758 t .Fatal (err )
5859 }
59- defer deleteTestDirs ( )
60+ defer os . RemoveAll ( testDir )
6061
6162 testCases := map [string ]struct {
6263 filePath string
@@ -337,18 +338,6 @@ func generateTestDirs() error {
337338 return nil
338339}
339340
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-
352341func generateJSONTestFiles () error {
353342 testData := []struct {
354343 fileName string
You can’t perform that action at this time.
0 commit comments