From 52475f8dd5db65f0c8866b6e9d5d819a6a41a57a Mon Sep 17 00:00:00 2001 From: Yong Tang Date: Tue, 15 Jan 2019 04:58:30 +0000 Subject: [PATCH] Replace t.Fatal(err) with assert.NilError(t, err) So that they are consistent with integration tests style Signed-off-by: Yong Tang --- integration/container/update_linux_test.go | 7 +++---- integration/plugin/volumes/helpers_test.go | 9 +++------ 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/integration/container/update_linux_test.go b/integration/container/update_linux_test.go index 5c37bce768..2f2b0bb63b 100644 --- a/integration/container/update_linux_test.go +++ b/integration/container/update_linux_test.go @@ -81,13 +81,12 @@ func TestUpdateCPUQuota(t *testing.T) { {desc: "a lower value", update: 10000}, {desc: "unset value", update: -1}, } { - if _, err := client.ContainerUpdate(ctx, cID, containertypes.UpdateConfig{ + _, err := client.ContainerUpdate(ctx, cID, containertypes.UpdateConfig{ Resources: containertypes.Resources{ CPUQuota: test.update, }, - }); err != nil { - t.Fatal(err) - } + }) + assert.NilError(t, err) inspect, err := client.ContainerInspect(ctx, cID) assert.NilError(t, err) diff --git a/integration/plugin/volumes/helpers_test.go b/integration/plugin/volumes/helpers_test.go index 53e671b509..8d0b06bb9d 100644 --- a/integration/plugin/volumes/helpers_test.go +++ b/integration/plugin/volumes/helpers_test.go @@ -12,6 +12,7 @@ import ( "github.com/docker/docker/internal/test/fixtures/plugin" "github.com/docker/docker/pkg/locker" "github.com/pkg/errors" + "gotest.tools/assert" ) var pluginBuildLock = locker.New() @@ -32,9 +33,7 @@ func ensurePlugin(t *testing.T, name string) string { } goBin, err := exec.LookPath("go") - if err != nil { - t.Fatal(err) - } + assert.NilError(t, err) cmd := exec.Command(goBin, "build", "-o", installPath, "./"+filepath.Join("cmd", name)) 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...) cancel() - if err != nil { - t.Fatal(err) - } + assert.NilError(t, err) } func asVolumeDriver(cfg *plugin.Config) {