Skip to content

Commit

Permalink
Merge pull request moby#40112 from thaJeztah/cut_the_noise
Browse files Browse the repository at this point in the history
integration-cli: don't log "Creating new daemon" logs, and print correct line numbers
  • Loading branch information
tiborvass authored Oct 24, 2019
2 parents a30990b + 56230f4 commit 2cf86a0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions integration-cli/check_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,7 @@ func (s *DockerSwarmSuite) SetUpTest(c *testing.T) {
}

func (s *DockerSwarmSuite) AddDaemon(c *testing.T, joinSwarm, manager bool) *daemon.Daemon {
c.Helper()
d := daemon.New(c, dockerBinary, dockerdBinary,
testdaemon.WithEnvironment(testEnv.Execution),
testdaemon.WithSwarmPort(defaultSwarmPort+s.portIndex),
Expand Down
6 changes: 4 additions & 2 deletions integration-cli/daemon/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ type Daemon struct {
// This will create a directory such as d123456789 in the folder specified by $DOCKER_INTEGRATION_DAEMON_DEST or $DEST.
// The daemon will not automatically start.
func New(t testing.TB, dockerBinary string, dockerdBinary string, ops ...daemon.Option) *Daemon {
t.Helper()
ops = append(ops, daemon.WithDockerdBinary(dockerdBinary))
d := daemon.New(t, ops...)
return &Daemon{
Expand Down Expand Up @@ -78,9 +79,10 @@ func (d *Daemon) inspectFieldWithError(name, field string) (string, error) {

// CheckActiveContainerCount returns the number of active containers
// FIXME(vdemeester) should re-use ActivateContainers in some way
func (d *Daemon) CheckActiveContainerCount(c *testing.T) (interface{}, string) {
func (d *Daemon) CheckActiveContainerCount(t *testing.T) (interface{}, string) {
t.Helper()
out, err := d.Cmd("ps", "-q")
assert.NilError(c, err)
assert.NilError(t, err)
if len(strings.TrimSpace(out)) == 0 {
return 0, ""
}
Expand Down
3 changes: 1 addition & 2 deletions testutil/daemon/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,8 @@ func New(t testing.TB, ops ...Option) *Daemon {

assert.Check(t, dest != "", "Please set the DOCKER_INTEGRATION_DAEMON_DEST or the DEST environment variable")

t.Logf("Creating a new daemon at: %q", dest)
d, err := NewDaemon(dest, ops...)
assert.NilError(t, err, "could not create daemon")
assert.NilError(t, err, "could not create daemon at %q", dest)

return d
}
Expand Down

0 comments on commit 2cf86a0

Please sign in to comment.