1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-02-01 13:07:49 +02:00

test: skip sbom tests locally if not syft

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
This commit is contained in:
Carlos A Becker 2022-11-04 16:00:29 -03:00
parent 914d3d5941
commit 4f2c0ce34a
No known key found for this signature in database
GPG Key ID: E61E2F7DC14AB940

View File

@ -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