1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

integration-cli: mark some test-helpers as helpers

Before:

    daemon.go:26: Creating a new daemon at: "/go/src/github.com/docker/docker/bundles/test-integration/TestDockerSwarmSuite/TestSwarmNetworkCreateDup"

After:

    docker_cli_swarm_test.go:1522: Creating a new daemon at: "/go/src/github.com/docker/docker/bundles/test-integration/TestDockerSwarmSuite/TestSwarmNetworkCreateDup"

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2019-10-21 12:40:22 +02:00
parent ac5acef69e
commit 060e55d7dd
No known key found for this signature in database
GPG key ID: 76698F39D527CE8C
2 changed files with 5 additions and 2 deletions

View file

@ -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),

View file

@ -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{
@ -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, ""
}