Skip to content

Commit

Permalink
fix test to account for go pkg stdlib
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
  • Loading branch information
wagoodman committed Oct 10, 2023
1 parent dee10ba commit 32023c3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion test/integration/match_by_image_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,8 @@ func addGolangMatches(t *testing.T, theSource source.Source, catalog *syftPkg.Co
}

binPackages := catalog.PackagesByPath("/go-app")
if len(binPackages) != 2 {
// contains 2 package + a single stdlib package
if len(binPackages) != 3 {
t.Logf("Golang Bin Packages: %+v", binPackages)
t.Fatalf("problem with upstream syft cataloger (golang)")
}
Expand All @@ -267,6 +268,10 @@ func addGolangMatches(t *testing.T, theSource source.Source, catalog *syftPkg.Co
continue
}

if p.Name == "stdlib" {
continue
}

thePkg := pkg.New(p)
theVuln := theStore.backend["github:language:go"][thePkg.Name][0]
vulnObj, err := vulnerability.NewVulnerability(theVuln)
Expand Down

0 comments on commit 32023c3

Please sign in to comment.