Browse code

Merge pull request #40112 from thaJeztah/cut_the_noise

integration-cli: don't log "Creating new daemon" logs, and print correct line numbers

Tibor Vass authored on 2019/10/25 03:24:24
Showing 3 changed files
... ...
@@ -349,6 +349,7 @@ func (s *DockerSwarmSuite) SetUpTest(c *testing.T) {
349 349
 }
350 350
 
351 351
 func (s *DockerSwarmSuite) AddDaemon(c *testing.T, joinSwarm, manager bool) *daemon.Daemon {
352
+	c.Helper()
352 353
 	d := daemon.New(c, dockerBinary, dockerdBinary,
353 354
 		testdaemon.WithEnvironment(testEnv.Execution),
354 355
 		testdaemon.WithSwarmPort(defaultSwarmPort+s.portIndex),
... ...
@@ -22,6 +22,7 @@ type Daemon struct {
22 22
 // This will create a directory such as d123456789 in the folder specified by $DOCKER_INTEGRATION_DAEMON_DEST or $DEST.
23 23
 // The daemon will not automatically start.
24 24
 func New(t testing.TB, dockerBinary string, dockerdBinary string, ops ...daemon.Option) *Daemon {
25
+	t.Helper()
25 26
 	ops = append(ops, daemon.WithDockerdBinary(dockerdBinary))
26 27
 	d := daemon.New(t, ops...)
27 28
 	return &Daemon{
... ...
@@ -78,9 +79,10 @@ func (d *Daemon) inspectFieldWithError(name, field string) (string, error) {
78 78
 
79 79
 // CheckActiveContainerCount returns the number of active containers
80 80
 // FIXME(vdemeester) should re-use ActivateContainers in some way
81
-func (d *Daemon) CheckActiveContainerCount(c *testing.T) (interface{}, string) {
81
+func (d *Daemon) CheckActiveContainerCount(t *testing.T) (interface{}, string) {
82
+	t.Helper()
82 83
 	out, err := d.Cmd("ps", "-q")
83
-	assert.NilError(c, err)
84
+	assert.NilError(t, err)
84 85
 	if len(strings.TrimSpace(out)) == 0 {
85 86
 		return 0, ""
86 87
 	}
... ...
@@ -148,9 +148,8 @@ func New(t testing.TB, ops ...Option) *Daemon {
148 148
 
149 149
 	assert.Check(t, dest != "", "Please set the DOCKER_INTEGRATION_DAEMON_DEST or the DEST environment variable")
150 150
 
151
-	t.Logf("Creating a new daemon at: %q", dest)
152 151
 	d, err := NewDaemon(dest, ops...)
153
-	assert.NilError(t, err, "could not create daemon")
152
+	assert.NilError(t, err, "could not create daemon at %q", dest)
154 153
 
155 154
 	return d
156 155
 }