mirror of
https://github.com/goreleaser/goreleaser.git
synced 2025-01-26 04:22:05 +02:00
test: fixed tests
broken because of dist not being removed anymore
This commit is contained in:
parent
f3fcb48983
commit
07c04b33f8
@ -40,8 +40,8 @@ func init() {
|
|||||||
var pipes = []pipeline.Piper{
|
var pipes = []pipeline.Piper{
|
||||||
defaults.Pipe{}, // load default configs
|
defaults.Pipe{}, // load default configs
|
||||||
dist.Pipe{}, // ensure ./dist is clean
|
dist.Pipe{}, // ensure ./dist is clean
|
||||||
effectiveconfig.Pipe{}, // writes the actual config (with defaults et al set) to dist
|
|
||||||
git.Pipe{}, // get and validate git repo state
|
git.Pipe{}, // get and validate git repo state
|
||||||
|
effectiveconfig.Pipe{}, // writes the actual config (with defaults et al set) to dist
|
||||||
changelog.Pipe{}, // builds the release changelog
|
changelog.Pipe{}, // builds the release changelog
|
||||||
env.Pipe{}, // load and validate environment variables
|
env.Pipe{}, // load and validate environment variables
|
||||||
build.Pipe{}, // build
|
build.Pipe{}, // build
|
||||||
|
2
pipeline/dist/dist.go
vendored
2
pipeline/dist/dist.go
vendored
@ -49,5 +49,5 @@ func (Pipe) Run(ctx *context.Context) (err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func mkdir(ctx *context.Context) error {
|
func mkdir(ctx *context.Context) error {
|
||||||
return os.Mkdir(ctx.Config.Dist, 0755)
|
return os.MkdirAll(ctx.Config.Dist, 0755)
|
||||||
}
|
}
|
||||||
|
7
pipeline/dist/dist_test.go
vendored
7
pipeline/dist/dist_test.go
vendored
@ -12,12 +12,15 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func TestDistDoesNotExist(t *testing.T) {
|
func TestDistDoesNotExist(t *testing.T) {
|
||||||
|
folder, err := ioutil.TempDir("", "disttest")
|
||||||
|
assert.NoError(t, err)
|
||||||
|
var dist = filepath.Join(folder, "dist")
|
||||||
assert.NoError(
|
assert.NoError(
|
||||||
t,
|
t,
|
||||||
Pipe{}.Run(
|
Pipe{}.Run(
|
||||||
&context.Context{
|
&context.Context{
|
||||||
Config: config.Project{
|
Config: config.Project{
|
||||||
Dist: "/wtf-this-shouldnt-exist",
|
Dist: dist,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@ -55,7 +58,7 @@ func TestEmptyDistExists(t *testing.T) {
|
|||||||
}
|
}
|
||||||
assert.NoError(t, Pipe{}.Run(ctx))
|
assert.NoError(t, Pipe{}.Run(ctx))
|
||||||
_, err = os.Stat(dist)
|
_, err = os.Stat(dist)
|
||||||
assert.False(t, os.IsExist(err))
|
assert.False(t, os.IsNotExist(err))
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestDescription(t *testing.T) {
|
func TestDescription(t *testing.T) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user