From 02cf45cb7ef218e514a5c292dd50ee80f15fe9d7 Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Mon, 3 Jul 2017 01:31:57 -0300 Subject: [PATCH] more build pipe tests --- pipeline/build/build_test.go | 36 ++++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/pipeline/build/build_test.go b/pipeline/build/build_test.go index 66f67a88b..7cf6d74f9 100644 --- a/pipeline/build/build_test.go +++ b/pipeline/build/build_test.go @@ -192,26 +192,30 @@ func TestRunPipeWithInvalidOS(t *testing.T) { func TestRunInvalidNametemplate(t *testing.T) { var assert = assert.New(t) - var ctx = &context.Context{ - Config: config.Project{ - Builds: []config.Build{ - { - Binary: "nametest", - Flags: "-v", - Goos: []string{ - runtime.GOOS, - }, - Goarch: []string{ - runtime.GOARCH, + for _, format := range []string{"tar.gz", "zip", "binary"} { + var ctx = &context.Context{ + Config: config.Project{ + ProjectName: "nameeeee", + Builds: []config.Build{ + { + Binary: "namet{{.est}", + Flags: "-v", + Goos: []string{ + runtime.GOOS, + }, + Goarch: []string{ + runtime.GOARCH, + }, }, }, + Archive: config.Archive{ + Format: format, + NameTemplate: "{{.Binary}", + }, }, - Archive: config.Archive{ - NameTemplate: "{{.Binary}_{{.Os}}_{{.Arch}}_{{.Version}}", - }, - }, + } + assert.Error(Pipe{}.Run(ctx)) } - assert.Error(Pipe{}.Run(ctx)) } func TestRunInvalidLdflags(t *testing.T) {