Skip to content

Commit

Permalink
test: skip sbom tests locally if not syft
Browse files Browse the repository at this point in the history
Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
  • Loading branch information
caarlos0 committed Nov 4, 2022
1 parent 914d3d5 commit 4f2c0ce
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions internal/pipe/sbom/sbom_test.go
Expand Up @@ -9,6 +9,7 @@ import (
"testing"

"github.com/goreleaser/goreleaser/internal/artifact"
"github.com/goreleaser/goreleaser/internal/testlib"
"github.com/goreleaser/goreleaser/pkg/config"
"github.com/goreleaser/goreleaser/pkg/context"
"github.com/stretchr/testify/assert"
Expand Down Expand Up @@ -143,6 +144,7 @@ func TestSBOMCatalogDefault(t *testing.T) {

for _, test := range tests {
t.Run(fmt.Sprintf("artifact=%q", test.configs[0].Artifacts), func(t *testing.T) {
testlib.CheckPath(t, "syft")
ctx := &context.Context{
Config: config.Project{
SBOMs: test.configs,
Expand Down Expand Up @@ -446,6 +448,7 @@ func TestSBOMCatalogArtifacts(t *testing.T) {

func testSBOMCataloging(tb testing.TB, ctx *context.Context, sbomPaths, sbomNames []string, expectedErrMsg string) {
tb.Helper()
testlib.CheckPath(tb, "syft")
tmpdir := tb.TempDir()

ctx.Config.Dist = tmpdir
Expand Down

0 comments on commit 4f2c0ce

Please sign in to comment.