fix: include packages unless it is not needed (#6765)

Signed-off-by: knqyf263 <knqyf263@gmail.com>
This commit is contained in:
Teppei Fukuda
2024-05-28 11:22:45 +04:00
committed by GitHub
parent 5ccfd17fd8
commit 56dbe1f676
32 changed files with 1880 additions and 612 deletions

View File

@@ -39,10 +39,10 @@ type csArgs struct {
func TestClientServer(t *testing.T) {
tests := []struct {
name string
args csArgs
golden string
wantErr string
name string
args csArgs
golden string
override func(t *testing.T, want, got *types.Report)
}{
{
name: "alpine 3.9",
@@ -270,6 +270,9 @@ func TestClientServer(t *testing.T) {
Target: "https://github.com/knqyf263/trivy-ci-test",
},
golden: "testdata/test-repo.json.golden",
override: func(t *testing.T, want, got *types.Report) {
want.ArtifactName = "https://github.com/knqyf263/trivy-ci-test"
},
},
}
@@ -284,7 +287,7 @@ func TestClientServer(t *testing.T) {
}
runTest(t, osArgs, tt.golden, "", types.FormatJSON, runOptions{
override: overrideUID,
override: overrideFuncs(overrideUID, tt.override),
})
})
}