Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: include packages unless it is not needed #6765

Merged
merged 9 commits into from
May 28, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
test(integration): add a common test between repo and client/server
Signed-off-by: knqyf263 <knqyf263@gmail.com>
  • Loading branch information
knqyf263 committed May 24, 2024
commit 6e49dd99485e873bf6f7083a6ee45fbb9d51099f
13 changes: 8 additions & 5 deletions integration/client_server_test.go
Original file line number Diff line number Diff line change
@@ -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),
})
})
}
8 changes: 8 additions & 0 deletions integration/repo_test.go
Original file line number Diff line number Diff line change
@@ -234,6 +234,14 @@ func TestRepository(t *testing.T) {
},
golden: "testdata/composer.lock.json.golden",
},
{
name: "multiple lockfiles",
args: args{
scanner: types.VulnerabilityScanner,
input: "testdata/fixtures/repo/trivy-ci-test",
},
golden: "testdata/test-repo.json.golden",
},
{
name: "dockerfile",
args: args{
Loading