Merge pull request #38572 from yongtang/assert.NilError

Replace t.Fatal(err) with assert.NilError(t, err)
This commit is contained in:
Sebastiaan van Stijn 2019-01-15 15:16:57 +01:00 committed by GitHub
commit e21f50cbf0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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: "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)

View file

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