From 415e4e0334fa6c491811af82e42a92752b24ef1f Mon Sep 17 00:00:00 2001 From: Jorin Vogel Date: Mon, 5 Jun 2017 19:21:33 +0200 Subject: [PATCH] Log name of skipped archive binary. Make tests consistent. --- pipeline/archive/archive.go | 5 +++-- pipeline/archive/archive_test.go | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/pipeline/archive/archive.go b/pipeline/archive/archive.go index cc78814db..24ee355c1 100644 --- a/pipeline/archive/archive.go +++ b/pipeline/archive/archive.go @@ -77,8 +77,9 @@ func create(ctx *context.Context, platform, name string) error { } func skip(ctx *context.Context, platform, name string) error { - log.Println("Skip archiving") - var binary = filepath.Join(ctx.Config.Dist, name+ext.For(platform)) + b := name + ext.For(platform) + log.Printf("Skip archiving for binary %s", b) + var binary = filepath.Join(ctx.Config.Dist, b) ctx.AddArtifact(binary) return nil } diff --git a/pipeline/archive/archive_test.go b/pipeline/archive/archive_test.go index de3c273be..959732743 100644 --- a/pipeline/archive/archive_test.go +++ b/pipeline/archive/archive_test.go @@ -100,7 +100,9 @@ func TestRunPipeSkip(t *testing.T) { }, } assert.NoError(Pipe{}.Run(ctx)) - assert.Equal([]string{"mybin.exe", "mybin"}, ctx.Artifacts) + assert.Contains(ctx.Artifacts, "mybin") + assert.Contains(ctx.Artifacts, "mybin.exe") + assert.Len(ctx.Artifacts, 2) } func TestRunPipeDistRemoved(t *testing.T) {