This commit is contained in:
Casey Lee 2019-01-15 23:12:10 -08:00
parent 88847aed71
commit 3c4c5a15b4
No known key found for this signature in database
GPG Key ID: 4CC378651BF9C168
3 changed files with 6 additions and 6 deletions

View File

@ -4,8 +4,8 @@ import (
"bytes" "bytes"
"errors" "errors"
"fmt" "fmt"
"io/ioutil"
"io" "io"
"io/ioutil"
"os" "os"
"path/filepath" "path/filepath"

View File

@ -22,11 +22,11 @@ func TestNewWorkflow(t *testing.T) {
runcount := 0 runcount := 0
successWorkflow := NewPipelineExecutor( successWorkflow := NewPipelineExecutor(
func() error { func() error {
runcount ++ runcount++
return nil return nil
}, },
func() error { func() error {
runcount ++ runcount++
return nil return nil
}) })
assert.Nil(successWorkflow()) assert.Nil(successWorkflow())

View File

@ -32,7 +32,7 @@ type dockerMessage struct {
func (i *DockerExecutorInput) logDockerOutput(dockerResponse io.Reader) { func (i *DockerExecutorInput) logDockerOutput(dockerResponse io.Reader) {
scanner := bufio.NewScanner(dockerResponse) scanner := bufio.NewScanner(dockerResponse)
if i.Logger == nil { if i.Logger == nil {
return return
} }
for scanner.Scan() { for scanner.Scan() {
i.Logger.Infof(scanner.Text()) i.Logger.Infof(scanner.Text())
@ -66,7 +66,7 @@ func (i *DockerExecutorInput) writeLog(isError bool, format string, args ...inte
func (i *DockerExecutorInput) logDockerResponse(dockerResponse io.ReadCloser, isError bool) { func (i *DockerExecutorInput) logDockerResponse(dockerResponse io.ReadCloser, isError bool) {
if dockerResponse == nil { if dockerResponse == nil {
return return
} }
defer dockerResponse.Close() defer dockerResponse.Close()
@ -83,7 +83,7 @@ func (i *DockerExecutorInput) logDockerResponse(dockerResponse io.ReadCloser, is
if err := json.Unmarshal(line, &msg); err == nil { if err := json.Unmarshal(line, &msg); err == nil {
if msg.Error != "" { if msg.Error != "" {
i.writeLog(isError, "%s", msg.Error) i.writeLog(isError, "%s", msg.Error)
return return
} }
if msg.Status != "" { if msg.Status != "" {