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

refactor: --skip=item (#4272)

Laying the ground work to allow skipping more pipes without adding new
flags et al.

---------

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
This commit is contained in:
Carlos Alexandro Becker
2023-09-16 17:01:20 -03:00
committed by GitHub
parent 85c86d61cf
commit 622c426eb3
33 changed files with 458 additions and 153 deletions

View File

@ -6,6 +6,7 @@ import (
"path/filepath"
"testing"
"github.com/goreleaser/goreleaser/internal/skips"
"github.com/goreleaser/goreleaser/internal/testctx"
"github.com/goreleaser/goreleaser/internal/testlib"
"github.com/goreleaser/goreleaser/pkg/config"
@ -112,7 +113,7 @@ func TestDirty(t *testing.T) {
require.Contains(t, err.Error(), "git is in a dirty state")
})
t.Run("skip validate is set", func(t *testing.T) {
ctx := testctx.New(testctx.SkipValidate)
ctx := testctx.New(testctx.Skip(skips.Validate))
testlib.AssertSkipped(t, Pipe{}.Run(ctx))
require.True(t, ctx.Git.Dirty)
})
@ -162,7 +163,7 @@ func TestShallowClone(t *testing.T) {
require.NoError(t, Pipe{}.Run(testctx.New()))
})
t.Run("skip validate is set", func(t *testing.T) {
ctx := testctx.New(testctx.SkipValidate)
ctx := testctx.New(testctx.Skip(skips.Validate))
testlib.AssertSkipped(t, Pipe{}.Run(ctx))
})
t.Run("snapshot", func(t *testing.T) {