Automated migration using

gty-migrate-from-testify --ignore-build-tags

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 6be0f709830113966f295401327b027ec2f0bbca
Component: engine
This commit is contained in:
Daniel Nephin
2018-03-16 11:03:43 -04:00
parent 1c9c9f9e72
commit 60daf5fa97
183 changed files with 2253 additions and 2199 deletions
@@ -24,14 +24,14 @@ import (
"github.com/docker/go-connections/sockets"
"github.com/docker/go-connections/tlsconfig"
"github.com/go-check/check"
"github.com/gotestyourself/gotestyourself/assert"
"github.com/gotestyourself/gotestyourself/icmd"
"github.com/pkg/errors"
"github.com/stretchr/testify/require"
"golang.org/x/net/context"
)
type testingT interface {
require.TestingT
assert.TestingT
logT
Fatalf(string, ...interface{})
}
@@ -487,20 +487,20 @@ func (d *Daemon) handleUserns() {
// LoadBusybox image into the daemon
func (d *Daemon) LoadBusybox(t testingT) {
clientHost, err := client.NewEnvClient()
require.NoError(t, err, "failed to create client")
assert.NilError(t, err, "failed to create client")
defer clientHost.Close()
ctx := context.Background()
reader, err := clientHost.ImageSave(ctx, []string{"busybox:latest"})
require.NoError(t, err, "failed to download busybox")
assert.NilError(t, err, "failed to download busybox")
defer reader.Close()
client, err := d.NewClient()
require.NoError(t, err, "failed to create client")
assert.NilError(t, err, "failed to create client")
defer client.Close()
resp, err := client.ImageLoad(ctx, reader, true)
require.NoError(t, err, "failed to load busybox")
assert.NilError(t, err, "failed to load busybox")
defer resp.Body.Close()
}
@@ -563,11 +563,11 @@ func (d *Daemon) WaitRun(contID string) error {
}
// Info returns the info struct for this daemon
func (d *Daemon) Info(t require.TestingT) types.Info {
func (d *Daemon) Info(t assert.TestingT) types.Info {
apiclient, err := client.NewClientWithOpts(client.WithHost((d.Sock())))
require.NoError(t, err)
assert.NilError(t, err)
info, err := apiclient.Info(context.Background())
require.NoError(t, err)
assert.NilError(t, err)
return info
}
@@ -11,8 +11,8 @@ import (
"github.com/docker/docker/client"
"github.com/docker/docker/integration-cli/checker"
"github.com/go-check/check"
"github.com/gotestyourself/gotestyourself/assert"
"github.com/pkg/errors"
"github.com/stretchr/testify/require"
"golang.org/x/net/context"
)
@@ -235,12 +235,12 @@ func (d *Swarm) CheckServiceUpdateState(service string) func(*check.C) (interfac
func (d *Swarm) CheckPluginRunning(plugin string) func(c *check.C) (interface{}, check.CommentInterface) {
return func(c *check.C) (interface{}, check.CommentInterface) {
apiclient, err := d.NewClient()
require.NoError(c, err)
assert.NilError(c, err)
resp, _, err := apiclient.PluginInspectWithRaw(context.Background(), plugin)
if client.IsErrNotFound(err) {
return false, check.Commentf("%v", err)
}
require.NoError(c, err)
assert.NilError(c, err)
return resp.Enabled, check.Commentf("%+v", resp)
}
}
@@ -249,12 +249,12 @@ func (d *Swarm) CheckPluginRunning(plugin string) func(c *check.C) (interface{},
func (d *Swarm) CheckPluginImage(plugin string) func(c *check.C) (interface{}, check.CommentInterface) {
return func(c *check.C) (interface{}, check.CommentInterface) {
apiclient, err := d.NewClient()
require.NoError(c, err)
assert.NilError(c, err)
resp, _, err := apiclient.PluginInspectWithRaw(context.Background(), plugin)
if client.IsErrNotFound(err) {
return false, check.Commentf("%v", err)
}
require.NoError(c, err)
assert.NilError(c, err)
return resp.PluginReference, check.Commentf("%+v", resp)
}
}