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

Replace t.Fatal(err) with assert.NilError(t, err)

So that they are consistent with integration tests style

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
This commit is contained in:
Yong Tang 2019-01-15 04:58:30 +00:00
parent 8472e04f79
commit 52475f8dd5
2 changed files with 6 additions and 10 deletions

View file

@ -81,13 +81,12 @@ func TestUpdateCPUQuota(t *testing.T) {
{desc: "a lower value", update: 10000}, {desc: "a lower value", update: 10000},
{desc: "unset value", update: -1}, {desc: "unset value", update: -1},
} { } {
if _, err := client.ContainerUpdate(ctx, cID, containertypes.UpdateConfig{ _, err := client.ContainerUpdate(ctx, cID, containertypes.UpdateConfig{
Resources: containertypes.Resources{ Resources: containertypes.Resources{
CPUQuota: test.update, CPUQuota: test.update,
}, },
}); err != nil { })
t.Fatal(err) assert.NilError(t, err)
}
inspect, err := client.ContainerInspect(ctx, cID) inspect, err := client.ContainerInspect(ctx, cID)
assert.NilError(t, err) assert.NilError(t, err)

View file

@ -12,6 +12,7 @@ import (
"github.com/docker/docker/internal/test/fixtures/plugin" "github.com/docker/docker/internal/test/fixtures/plugin"
"github.com/docker/docker/pkg/locker" "github.com/docker/docker/pkg/locker"
"github.com/pkg/errors" "github.com/pkg/errors"
"gotest.tools/assert"
) )
var pluginBuildLock = locker.New() var pluginBuildLock = locker.New()
@ -32,9 +33,7 @@ func ensurePlugin(t *testing.T, name string) string {
} }
goBin, err := exec.LookPath("go") goBin, err := exec.LookPath("go")
if err != nil { assert.NilError(t, err)
t.Fatal(err)
}
cmd := exec.Command(goBin, "build", "-o", installPath, "./"+filepath.Join("cmd", name)) cmd := exec.Command(goBin, "build", "-o", installPath, "./"+filepath.Join("cmd", name))
cmd.Env = append(os.Environ(), "CGO_ENABLED=0") cmd.Env = append(os.Environ(), "CGO_ENABLED=0")
@ -61,9 +60,7 @@ func createPlugin(t *testing.T, client plugin.CreateClient, alias, bin string, o
err := plugin.Create(ctx, client, alias, opts...) err := plugin.Create(ctx, client, alias, opts...)
cancel() cancel()
if err != nil { assert.NilError(t, err)
t.Fatal(err)
}
} }
func asVolumeDriver(cfg *plugin.Config) { func asVolumeDriver(cfg *plugin.Config) {