mirror of
https://github.com/aquasecurity/trivy.git
synced 2025-12-23 15:37:50 -08:00
test: include integration tests in linting and fix all issues (#9060)
This commit is contained in:
@@ -8,10 +8,10 @@ import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
ftypes "github.com/aquasecurity/trivy/pkg/fanal/types"
|
||||
"github.com/aquasecurity/trivy/pkg/types"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestTar(t *testing.T) {
|
||||
@@ -168,7 +168,7 @@ func TestTar(t *testing.T) {
|
||||
Input: "testdata/fixtures/images/alpine-39.tar.gz",
|
||||
Distro: "alpine/3.10",
|
||||
},
|
||||
override: func(t *testing.T, want, got *types.Report) {
|
||||
override: func(_ *testing.T, want, _ *types.Report) {
|
||||
want.Metadata.OS.Name = "3.10"
|
||||
want.Results[0].Target = "testdata/fixtures/images/alpine-39.tar.gz (alpine 3.10)"
|
||||
},
|
||||
@@ -425,7 +425,7 @@ func TestTar(t *testing.T) {
|
||||
}
|
||||
if len(tt.args.IgnoreIDs) != 0 {
|
||||
trivyIgnore := ".trivyignore"
|
||||
err := os.WriteFile(trivyIgnore, []byte(strings.Join(tt.args.IgnoreIDs, "\n")), 0444)
|
||||
err := os.WriteFile(trivyIgnore, []byte(strings.Join(tt.args.IgnoreIDs, "\n")), 0o444)
|
||||
require.NoError(t, err, "failed to write .trivyignore")
|
||||
defer os.Remove(trivyIgnore)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user