mirror of
https://github.com/goreleaser/goreleaser.git
synced 2025-03-17 20:47:50 +02:00
test: fix data race
This commit is contained in:
parent
30feb1294f
commit
aae42e96d7
1
Makefile
1
Makefile
@ -7,6 +7,7 @@ export PATH := ./bin:$(PATH)
|
|||||||
|
|
||||||
# Install all the build and lint dependencies
|
# Install all the build and lint dependencies
|
||||||
setup:
|
setup:
|
||||||
|
rm -rf $$GOPATH/src/golang.org/x/tools
|
||||||
go get -u golang.org/x/tools/cmd/stringer
|
go get -u golang.org/x/tools/cmd/stringer
|
||||||
go get -u golang.org/x/tools/cmd/cover
|
go get -u golang.org/x/tools/cmd/cover
|
||||||
# TODO: temporary hack for https://github.com/golang/go/issues/21387
|
# TODO: temporary hack for https://github.com/golang/go/issues/21387
|
||||||
|
@ -18,18 +18,6 @@ func TestWithArtifact(t *testing.T) {
|
|||||||
}
|
}
|
||||||
ctx.Version = "1.0.0"
|
ctx.Version = "1.0.0"
|
||||||
ctx.Git.CurrentTag = "v1.0.0"
|
ctx.Git.CurrentTag = "v1.0.0"
|
||||||
var instance = New(ctx).WithArtifact(
|
|
||||||
artifact.Artifact{
|
|
||||||
Name: "not-this-binary",
|
|
||||||
Goarch: "amd64",
|
|
||||||
Goos: "linux",
|
|
||||||
Goarm: "6",
|
|
||||||
Extra: map[string]string{
|
|
||||||
"Binary": "binary",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
map[string]string{"linux": "Linux"},
|
|
||||||
)
|
|
||||||
for expect, tmpl := range map[string]string{
|
for expect, tmpl := range map[string]string{
|
||||||
"bar": "{{.Env.FOO}}",
|
"bar": "{{.Env.FOO}}",
|
||||||
"Linux": "{{.Os}}",
|
"Linux": "{{.Os}}",
|
||||||
@ -44,7 +32,18 @@ func TestWithArtifact(t *testing.T) {
|
|||||||
expect := expect
|
expect := expect
|
||||||
t.Run(expect, func(tt *testing.T) {
|
t.Run(expect, func(tt *testing.T) {
|
||||||
tt.Parallel()
|
tt.Parallel()
|
||||||
result, err := instance.Apply(tmpl)
|
result, err := New(ctx).WithArtifact(
|
||||||
|
artifact.Artifact{
|
||||||
|
Name: "not-this-binary",
|
||||||
|
Goarch: "amd64",
|
||||||
|
Goos: "linux",
|
||||||
|
Goarm: "6",
|
||||||
|
Extra: map[string]string{
|
||||||
|
"Binary": "binary",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
map[string]string{"linux": "Linux"},
|
||||||
|
).Apply(tmpl)
|
||||||
assert.NoError(tt, err)
|
assert.NoError(tt, err)
|
||||||
assert.Equal(tt, expect, result)
|
assert.Equal(tt, expect, result)
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user