Skip to content

Commit

Permalink
feat: add shared dir for easier cleanup (#1676)
Browse files Browse the repository at this point in the history
Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com>
  • Loading branch information
spiffcs authored Mar 16, 2023
1 parent 1899eb5 commit 928c4a5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/cli/spdx_tooling_validation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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...)
Expand All @@ -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
Expand All @@ -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)

Expand Down

0 comments on commit 928c4a5

Please sign in to comment.