From 4f2c0ce34a623043837310d7894df92aa77ef189 Mon Sep 17 00:00:00 2001 From: Carlos A Becker Date: Fri, 4 Nov 2022 16:00:29 -0300 Subject: [PATCH] test: skip sbom tests locally if not syft Signed-off-by: Carlos A Becker --- internal/pipe/sbom/sbom_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/pipe/sbom/sbom_test.go b/internal/pipe/sbom/sbom_test.go index 06ff57f485c..c89f8a78ec2 100644 --- a/internal/pipe/sbom/sbom_test.go +++ b/internal/pipe/sbom/sbom_test.go @@ -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" @@ -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, @@ -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