mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-05 02:09:56 +00:00
Merge pull request #119146 from xuexu6666/xuexu6666/ControllerUtilUseCmpDiff
Use cmp diff in controller_util_test.go
This commit is contained in:
commit
64939b66c6
@ -54,6 +54,7 @@ import (
|
||||
testingclock "k8s.io/utils/clock/testing"
|
||||
"k8s.io/utils/pointer"
|
||||
|
||||
"github.com/google/go-cmp/cmp"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
@ -397,10 +398,9 @@ func TestActivePodFiltering(t *testing.T) {
|
||||
gotNames.Insert(pod.Name)
|
||||
}
|
||||
|
||||
assert.Equal(t, 0, expectedNames.Difference(gotNames).Len(),
|
||||
"expected %v, got %v", expectedNames.List(), gotNames.List())
|
||||
assert.Equal(t, 0, gotNames.Difference(expectedNames).Len(),
|
||||
"expected %v, got %v", expectedNames.List(), gotNames.List())
|
||||
if diff := cmp.Diff(expectedNames.List(), gotNames.List()); diff != "" {
|
||||
t.Errorf("Active pod names (-want,+got):\n%s", diff)
|
||||
}
|
||||
}
|
||||
|
||||
func TestSortingActivePods(t *testing.T) {
|
||||
@ -618,10 +618,9 @@ func TestActiveReplicaSetsFiltering(t *testing.T) {
|
||||
gotNames.Insert(rs.Name)
|
||||
}
|
||||
|
||||
assert.Equal(t, 0, expectedNames.Difference(gotNames).Len(),
|
||||
"expected %v, got %v", expectedNames.List(), gotNames.List())
|
||||
assert.Equal(t, 0, gotNames.Difference(expectedNames).Len(),
|
||||
"expected %v, got %v", expectedNames.List(), gotNames.List())
|
||||
if diff := cmp.Diff(expectedNames.List(), gotNames.List()); diff != "" {
|
||||
t.Errorf("Active replica set names (-want,+got):\n%s", diff)
|
||||
}
|
||||
}
|
||||
|
||||
func TestComputeHash(t *testing.T) {
|
||||
|
Loading…
Reference in New Issue
Block a user