1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-06-23 00:40:06 +02:00

feat(ci): compile with go 1.19 (#3278)

* feat(ci): compile with go 1.19

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>

* test: fixing template test

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>

* test: improve check

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>

* fix: more test and docs fixes

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>

* test: fix

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>

* test: fix

* test: fix

* fix: lint

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>

* test: docker templates

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>

* fix: godoc for RequireTemplateError
This commit is contained in:
Carlos Alexandro Becker
2022-08-06 18:44:23 -03:00
committed by GitHub
parent f71230272b
commit ee17c9583d
24 changed files with 84 additions and 64 deletions

View File

@ -10,6 +10,7 @@ import (
"time"
"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/require"
@ -267,13 +268,13 @@ func TestRun(t *testing.T) {
})
t.Run("bad template", func(t *testing.T) {
require.EqualError(t, Pipe{}.Run(context.New(config.Project{
testlib.RequireTemplateError(t, Pipe{}.Run(context.New(config.Project{
UniversalBinaries: []config.UniversalBinary{
{
NameTemplate: "{{.Name}",
},
},
})), `template: tmpl:1: unexpected "}" in operand`)
})))
})
t.Run("no darwin builds", func(t *testing.T) {
@ -326,7 +327,7 @@ func TestRun(t *testing.T) {
Env: []string{"FOO=foo-{{.Tag}"},
}}
ctx.Config.UniversalBinaries[0].Hooks.Post = []config.Hook{}
require.EqualError(t, Pipe{}.Run(ctx), `pre hook failed: template: tmpl:1: unexpected "}" in operand`)
testlib.RequireTemplateError(t, Pipe{}.Run(ctx))
})
t.Run("hook with bad dir tmpl", func(t *testing.T) {
@ -336,7 +337,7 @@ func TestRun(t *testing.T) {
Dir: "{{.Tag}",
}}
ctx.Config.UniversalBinaries[0].Hooks.Post = []config.Hook{}
require.EqualError(t, Pipe{}.Run(ctx), `pre hook failed: template: tmpl:1: unexpected "}" in operand`)
testlib.RequireTemplateError(t, Pipe{}.Run(ctx))
})
t.Run("hook with bad cmd tmpl", func(t *testing.T) {
@ -345,7 +346,7 @@ func TestRun(t *testing.T) {
Cmd: "echo blah-{{.Tag }",
}}
ctx.Config.UniversalBinaries[0].Hooks.Post = []config.Hook{}
require.EqualError(t, Pipe{}.Run(ctx), `pre hook failed: template: tmpl:1: unexpected "}" in operand`)
testlib.RequireTemplateError(t, Pipe{}.Run(ctx))
})
}