cleanup: move scheduler plugin tests to use PodWrapper

Move scheduler plugin unit tests use testing PodWrapper
where applicable to reduce duplicating pod creation
code and shorten number of lines.

Signed-off-by: Yibo Zhuang <yibzhuang@gmail.com>
This commit is contained in:
Yibo Zhuang
2022-05-05 10:48:55 -07:00
parent fd08d47d8b
commit bc8f3198d5
18 changed files with 862 additions and 2830 deletions

View File

@@ -28,12 +28,11 @@ import (
"k8s.io/client-go/kubernetes/fake"
clienttesting "k8s.io/client-go/testing"
frameworkruntime "k8s.io/kubernetes/pkg/scheduler/framework/runtime"
st "k8s.io/kubernetes/pkg/scheduler/testing"
)
func TestDefaultBinder(t *testing.T) {
testPod := &v1.Pod{
ObjectMeta: metav1.ObjectMeta{Name: "foo", Namespace: "ns"},
}
testPod := st.MakePod().Name("foo").Namespace("ns").Obj()
testNode := "foohost.kubernetes.mydomain.com"
tests := []struct {
name string