tests: swap testify for test in more places (#20028)

* tests: swap testify for test in plugins/csi/client_test.go

* tests: swap testify for test in testutil/

* tests: swap testify for test in host_test.go

* tests: swap testify for test in plugin_test.go

* tests: swap testify for test in utils_test.go

* tests: swap testify for test in scheduler/

* tests: swap testify for test in parse_test.go

* tests: swap testify for test in attribute_test.go

* tests: swap testify for test in plugins/drivers/

* tests: swap testify for test in command/

* tests: fixup some test usages

* go: run go mod tidy

* windows: cpuset test only on linux
This commit is contained in:
Seth Hoenig
2024-02-29 12:11:35 -06:00
committed by GitHub
parent c2fe51bf11
commit 4d83733909
106 changed files with 1297 additions and 1567 deletions

View File

@@ -8,7 +8,7 @@ import (
"testing"
"github.com/hashicorp/nomad/helper/pointer"
"github.com/stretchr/testify/require"
"github.com/shoenig/test/must"
)
func TestAttribute_Validate(t *testing.T) {
@@ -77,7 +77,7 @@ func TestAttribute_Validate(t *testing.T) {
for _, c := range cases {
t.Run(c.Input.GoString(), func(t *testing.T) {
if err := c.Input.Validate(); err != nil && !c.Fail {
require.NoError(t, err)
must.NoError(t, err)
}
})
}
@@ -538,7 +538,7 @@ func testComparison(t *testing.T, cases []*compareTestCase) {
if !ok && !c.NotComparable {
t.Fatal("should be comparable")
} else if ok {
require.Equal(t, c.Expected, v)
must.Eq(t, c.Expected, v)
}
})
}
@@ -662,8 +662,8 @@ func TestAttribute_ParseAndValidate(t *testing.T) {
for _, c := range cases {
t.Run(c.Input, func(t *testing.T) {
a := ParseAttribute(c.Input)
require.Equal(t, c.Expected, a)
require.NoError(t, a.Validate())
must.Eq(t, c.Expected, a)
must.NoError(t, a.Validate())
})
}
}