Plugins: Make file system path handling in tests OS agnostic (#79651)

* make path handling OS agnostic

* PR feedback

* fix input for test case
This commit is contained in:
Will Browne
2023-12-19 11:01:48 +01:00
committed by GitHub
parent 8cb351e54a
commit ef60c90dfa
6 changed files with 19 additions and 14 deletions
+2 -2
View File
@@ -147,7 +147,7 @@ func TestParsePluginTestdata(t *testing.T) {
},
}
staticRootPath, err := filepath.Abs("../manager/testdata")
staticRootPath, err := filepath.Abs(filepath.Join("..", "manager", "testdata"))
require.NoError(t, err)
dfs := os.DirFS(staticRootPath)
ents, err := fs.ReadDir(dfs, ".")
@@ -240,7 +240,7 @@ func TestParseTreeZips(t *testing.T) {
},
}
staticRootPath, err := filepath.Abs("../storage/testdata")
staticRootPath, err := filepath.Abs(filepath.Join("..", "storage", "testdata"))
require.NoError(t, err)
ents, err := os.ReadDir(staticRootPath)
require.NoError(t, err)