From 928c4a55fff5ac6970902e512fad6ccbf5448ace Mon Sep 17 00:00:00 2001 From: Christopher Angelo Phillips <32073428+spiffcs@users.noreply.github.com> Date: Thu, 16 Mar 2023 16:05:34 -0400 Subject: [PATCH] feat: add shared dir for easier cleanup (#1676) Signed-off-by: Christopher Phillips --- test/cli/spdx_tooling_validation_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/cli/spdx_tooling_validation_test.go b/test/cli/spdx_tooling_validation_test.go index a061a35925e..593953b47c0 100644 --- a/test/cli/spdx_tooling_validation_test.go +++ b/test/cli/spdx_tooling_validation_test.go @@ -73,7 +73,7 @@ func TestSpdxValidationTooling(t *testing.T) { t.Run(test.name, func(t *testing.T) { // build the validation image test.setup(t) - + dir := t.TempDir() for _, image := range test.images { args := append(test.syftArgs, image) cmd, stdout, stderr := runSyft(t, test.env, args...) @@ -84,7 +84,7 @@ func TestSpdxValidationTooling(t *testing.T) { cwd, err := os.Getwd() require.NoError(t, err) - f, err := os.CreateTemp(t.TempDir(), "temp") + f, err := os.CreateTemp(dir, "temp") require.NoError(t, err) var suffix string @@ -95,7 +95,7 @@ func TestSpdxValidationTooling(t *testing.T) { } // spdx tooling only takes a file with suffix spdx - rename := path.Join(path.Dir(f.Name()), fmt.Sprintf("%s.%s", path.Base(f.Name()), suffix)) + rename := path.Join(path.Dir(f.Name()), fmt.Sprintf("%s%s", path.Base(f.Name()), suffix)) err = os.Rename(f.Name(), rename) require.NoError(t, err)