Remove reflect.DeepEqual for defaultpreemption, helper, and imagelocality package

This commit is contained in:
drfish
2021-02-09 23:37:36 +08:00
parent 6389c13960
commit ac0b034b02
6 changed files with 15 additions and 14 deletions

View File

@@ -20,7 +20,6 @@ import (
"context"
"fmt"
"math/rand"
"reflect"
"sort"
"strings"
"testing"
@@ -302,11 +301,11 @@ func TestPostFilter(t *testing.T) {
}
gotResult, gotStatus := p.PostFilter(context.TODO(), state, tt.pod, tt.filteredNodesStatuses)
if !reflect.DeepEqual(gotStatus, tt.wantStatus) {
t.Errorf("Status does not match: %v, want: %v", gotStatus, tt.wantStatus)
if diff := cmp.Diff(tt.wantStatus, gotStatus); diff != "" {
t.Errorf("Unexpected status (-want, +got):\n%s", diff)
}
if diff := cmp.Diff(gotResult, tt.wantResult); diff != "" {
t.Errorf("Unexpected postFilterResult (-want, +got): %s", diff)
if diff := cmp.Diff(tt.wantResult, gotResult); diff != "" {
t.Errorf("Unexpected postFilterResult (-want, +got):\n%s", diff)
}
})
}