Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Goodman <[email protected]>
  • Loading branch information
wagoodman committed Nov 22, 2024
1 parent c1d50ff commit 7334320
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 9 deletions.
5 changes: 4 additions & 1 deletion pkg/process/processors/github_processor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (

"github.com/anchore/grype-db/pkg/data"
"github.com/anchore/grype-db/pkg/process/internal/tests"
"github.com/anchore/grype-db/pkg/provider"
"github.com/anchore/grype-db/pkg/provider/unmarshal"
)

Expand All @@ -27,7 +28,9 @@ func TestGitHubProcessor_Process(t *testing.T) {
defer tests.CloseFile(f)

processor := NewGitHubProcessor(mockGithubProcessorTransform)
entries, err := processor.Process(f)
entries, err := processor.Process(f, provider.State{
Provider: "github",
})

assert.NoError(t, err)
assert.Len(t, entries, 3)
Expand Down
5 changes: 4 additions & 1 deletion pkg/process/processors/match_exclusion_processor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (

"github.com/anchore/grype-db/pkg/data"
"github.com/anchore/grype-db/pkg/process/internal/tests"
"github.com/anchore/grype-db/pkg/provider"
"github.com/anchore/grype-db/pkg/provider/unmarshal"
)

Expand All @@ -27,7 +28,9 @@ func TestMatchExclusionProcessor_Process(t *testing.T) {
defer tests.CloseFile(f)

processor := NewMatchExclusionProcessor(mockMatchExclusionProcessorTransform)
entries, err := processor.Process(f)
entries, err := processor.Process(f, provider.State{
Provider: "match-exclusions",
})

require.NoError(t, err)
assert.Len(t, entries, 3)
Expand Down
5 changes: 4 additions & 1 deletion pkg/process/processors/msrc_processor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (

"github.com/anchore/grype-db/pkg/data"
"github.com/anchore/grype-db/pkg/process/internal/tests"
"github.com/anchore/grype-db/pkg/provider"
"github.com/anchore/grype-db/pkg/provider/unmarshal"
)

Expand All @@ -27,7 +28,9 @@ func TestMSRCProcessor_Process(t *testing.T) {
defer tests.CloseFile(f)

processor := NewMSRCProcessor(mockMSRCProcessorTransform)
entries, err := processor.Process(f)
entries, err := processor.Process(f, provider.State{
Provider: "msrc",
})

require.NoError(t, err)
assert.Len(t, entries, 2)
Expand Down
5 changes: 4 additions & 1 deletion pkg/process/processors/nvd_processor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (

"github.com/anchore/grype-db/pkg/data"
"github.com/anchore/grype-db/pkg/process/internal/tests"
"github.com/anchore/grype-db/pkg/provider"
"github.com/anchore/grype-db/pkg/provider/unmarshal"
)

Expand All @@ -27,7 +28,9 @@ func TestNVDProcessor_Process(t *testing.T) {
defer tests.CloseFile(f)

processor := NewNVDProcessor(mockNVDProcessorTransform)
entries, err := processor.Process(f)
entries, err := processor.Process(f, provider.State{
Provider: "nvd",
})

require.NoError(t, err)
assert.Len(t, entries, 3)
Expand Down
5 changes: 4 additions & 1 deletion pkg/process/processors/os_processor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (

"github.com/anchore/grype-db/pkg/data"
"github.com/anchore/grype-db/pkg/process/internal/tests"
"github.com/anchore/grype-db/pkg/provider"
"github.com/anchore/grype-db/pkg/provider/unmarshal"
)

Expand All @@ -27,7 +28,9 @@ func TestOSProcessor_Process(t *testing.T) {
defer tests.CloseFile(f)

processor := NewOSProcessor(mockOSProcessorTransform)
entries, err := processor.Process(f)
entries, err := processor.Process(f, provider.State{
Provider: "rhel",
})

require.NoError(t, err)
assert.Len(t, entries, 4)
Expand Down
7 changes: 3 additions & 4 deletions pkg/process/v6/transformers/os/transform_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -532,10 +532,9 @@ func TestTransform(t *testing.T) {
VulnerabilityHandle: grypeDB.VulnerabilityHandle{
Name: "CVE-2011-4623",
BlobValue: &grypeDB.VulnerabilityBlob{
ID: "CVE-2011-4623",
ProviderName: "debian",
Status: "active",
PublishedDate: &timeVal,
ID: "CVE-2011-4623",
ProviderName: "debian",
Status: "active",
References: []grypeDB.Reference{
{
URL: "https://security-tracker.debian.org/tracker/CVE-2011-4623",
Expand Down

0 comments on commit 7334320

Please sign in to comment.