1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-03-17 20:47:50 +02:00

test: make test fail when either archive is not uploaded

This commit is contained in:
Carlos Alexandro Becker 2018-02-14 11:06:15 -02:00 committed by Carlos Alexandro Becker
parent 8da56da027
commit ba58ba05ab
2 changed files with 6 additions and 1 deletions

View File

@ -121,7 +121,6 @@ func doRun(ctx *context.Context) error {
switch v := strings.ToLower(instance.Mode); v {
case modeArchive:
err = runPipeByFilter(ctx, instance, artifact.ByType(artifact.UploadableArchive))
case modeBinary:
err = runPipeByFilter(ctx, instance, artifact.ByType(artifact.UploadableBinary))

View File

@ -242,6 +242,8 @@ func TestRunPipe_ModeArchive(t *testing.T) {
Path: debfile.Name(),
})
var uploads = map[string]bool{}
// Dummy artifactories
mux.HandleFunc("/example-repo-local/goreleaser/1.0.0/bin.tar.gz", func(w http.ResponseWriter, r *http.Request) {
testMethod(t, r, "PUT")
@ -267,6 +269,7 @@ func TestRunPipe_ModeArchive(t *testing.T) {
},
"uri" : "http://127.0.0.1:56563/example-repo-local/goreleaser/bin.tar.gz"
}`)
uploads["targz"] = true
})
mux.HandleFunc("/example-repo-local/goreleaser/1.0.0/bin.deb", func(w http.ResponseWriter, r *http.Request) {
testMethod(t, r, "PUT")
@ -292,9 +295,12 @@ func TestRunPipe_ModeArchive(t *testing.T) {
},
"uri" : "http://127.0.0.1:56563/example-repo-local/goreleaser/bin.deb"
}`)
uploads["deb"] = true
})
assert.NoError(t, Pipe{}.Run(ctx))
assert.True(t, uploads["targz"], "tar.gz file was not uploaded")
assert.True(t, uploads["deb"], "deb file was not uploaded")
}
func TestRunPipe_ArtifactoryDown(t *testing.T) {