Merge pull request #38572 from yongtang/assert.NilError
Replace t.Fatal(err) with assert.NilError(t, err)
This commit is contained in:
commit
e21f50cbf0
2 changed files with 6 additions and 10 deletions
|
@ -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)
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue