Skip to content

Commit

Permalink
WIP (#25) Add logs to the tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mdelapenya committed Nov 19, 2019
1 parent ca46331 commit b426008
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions compose.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import (
"path/filepath"
"runtime"
"strings"

"github.com/sirupsen/logrus"
)

const (
Expand Down Expand Up @@ -107,6 +109,7 @@ func execute(

var errStdout, errStderr error

logrus.Infof(">>>> Executing %s with args: %v", binary, args)
cmd := exec.Command(binary, args...)
cmd.Dir = dirContext
cmd.Env = os.Environ()
Expand Down
1 change: 1 addition & 0 deletions compose_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ func assertContainerEnvironmentVariables(t *testing.T, identifier string, presen

func checkIfError(t *testing.T, err ExecError) {
if err.Error != nil || err.Stdout != nil || err.Stderr != nil {
t.Logf("Failed when running: %v", err.Command)
t.Fatal(err)
}
}
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ require (
github.com/opencontainers/runc v0.1.1 // indirect
github.com/pkg/errors v0.8.1
github.com/satori/go.uuid v1.2.0
github.com/sirupsen/logrus v1.2.0 // indirect
github.com/sirupsen/logrus v1.2.0
github.com/stretchr/testify v1.2.2
golang.org/x/sys v0.0.0-20181228144115-9a3f9b0469bb // indirect
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c // indirect
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKoh
github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec=
github.com/docker/go-units v0.3.3 h1:Xk8S3Xj5sLGlG5g67hJmYMmUgXv5N4PhkjJHHqrwnTk=
github.com/docker/go-units v0.3.3/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk=
github.com/elastic/metricbeat-tests-poc v0.1.0-rc8 h1:qwle1ospkYAohtLnYQF6SqW60B5KNdSzE5QzPxz3fbs=
github.com/elastic/metricbeat-tests-poc/cli v0.0.0-20191119132306-d079856bc574 h1:Sl/zQTBkXbxOVkcxJe2slSBWwXRO5wFKq9dnY9ZVAVg=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/go-redis/redis v6.15.2+incompatible h1:9SpNVG76gr6InJGxoZ6IuuxaCOQwDAhzyXg+Bs+0Sb4=
github.com/go-redis/redis v6.15.2+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA=
Expand Down

0 comments on commit b426008

Please sign in to comment.