1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-03-19 20:57:53 +02:00

test: fix data race

This commit is contained in:
Carlos Alexandro Becker 2018-07-08 21:28:26 -07:00
parent 30feb1294f
commit aae42e96d7
No known key found for this signature in database
GPG Key ID: E61E2F7DC14AB940
2 changed files with 13 additions and 13 deletions

View File

@ -7,6 +7,7 @@ export PATH := ./bin:$(PATH)
# Install all the build and lint dependencies
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/cover
# TODO: temporary hack for https://github.com/golang/go/issues/21387

View File

@ -18,18 +18,6 @@ func TestWithArtifact(t *testing.T) {
}
ctx.Version = "1.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{
"bar": "{{.Env.FOO}}",
"Linux": "{{.Os}}",
@ -44,7 +32,18 @@ func TestWithArtifact(t *testing.T) {
expect := expect
t.Run(expect, func(tt *testing.T) {
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.Equal(tt, expect, result)
})