diff --git a/pkg/scheduler/factory/factory_test.go b/pkg/scheduler/factory/factory_test.go index d66f0c19fd7..c8efc9a7ee8 100644 --- a/pkg/scheduler/factory/factory_test.go +++ b/pkg/scheduler/factory/factory_test.go @@ -284,13 +284,13 @@ func TestDefaultErrorFunc(t *testing.T) { } handler := utiltesting.FakeHandler{ StatusCode: 200, - ResponseBody: runtime.EncodeOrDie(util.Test.Codec(), testPod), + ResponseBody: runtime.EncodeOrDie(schedulertesting.Test.Codec(), testPod), T: t, } mux := http.NewServeMux() // FakeHandler mustn't be sent requests other than the one you want to test. - mux.Handle(util.Test.ResourcePath(string(v1.ResourcePods), "bar", "foo"), &handler) + mux.Handle(schedulertesting.Test.ResourcePath(string(v1.ResourcePods), "bar", "foo"), &handler) server := httptest.NewServer(mux) defer server.Close() client := clientset.NewForConfigOrDie(&restclient.Config{Host: server.URL, ContentConfig: restclient.ContentConfig{GroupVersion: &legacyscheme.Registry.GroupOrDie(v1.GroupName).GroupVersions[0]}}) @@ -309,7 +309,7 @@ func TestDefaultErrorFunc(t *testing.T) { if !exists { continue } - handler.ValidateRequest(t, util.Test.ResourcePath(string(v1.ResourcePods), "bar", "foo"), "GET", nil) + handler.ValidateRequest(t, schedulertesting.Test.ResourcePath(string(v1.ResourcePods), "bar", "foo"), "GET", nil) if e, a := testPod, got; !reflect.DeepEqual(e, a) { t.Errorf("Expected %v, got %v", e, a) } @@ -371,9 +371,9 @@ func TestBind(t *testing.T) { t.Errorf("Unexpected error: %v", err) continue } - expectedBody := runtime.EncodeOrDie(util.Test.Codec(), item.binding) + expectedBody := runtime.EncodeOrDie(schedulertesting.Test.Codec(), item.binding) handler.ValidateRequest(t, - util.Test.SubResourcePath(string(v1.ResourcePods), metav1.NamespaceDefault, "foo", "binding"), + schedulertesting.Test.SubResourcePath(string(v1.ResourcePods), metav1.NamespaceDefault, "foo", "binding"), "POST", &expectedBody) } } diff --git a/pkg/scheduler/scheduler_test.go b/pkg/scheduler/scheduler_test.go index e4f722178d0..abd131708bc 100644 --- a/pkg/scheduler/scheduler_test.go +++ b/pkg/scheduler/scheduler_test.go @@ -40,7 +40,6 @@ import ( "k8s.io/kubernetes/pkg/scheduler/core" "k8s.io/kubernetes/pkg/scheduler/schedulercache" schedulertesting "k8s.io/kubernetes/pkg/scheduler/testing" - "k8s.io/kubernetes/pkg/scheduler/util" "k8s.io/kubernetes/pkg/scheduler/volumebinder" ) @@ -79,7 +78,7 @@ func podWithID(id, desiredHost string) *v1.Pod { ObjectMeta: metav1.ObjectMeta{ Name: id, UID: types.UID(id), - SelfLink: util.Test.SelfLink(string(v1.ResourcePods), id), + SelfLink: schedulertesting.Test.SelfLink(string(v1.ResourcePods), id), }, Spec: v1.PodSpec{ NodeName: desiredHost, @@ -93,7 +92,7 @@ func deletingPod(id string) *v1.Pod { ObjectMeta: metav1.ObjectMeta{ Name: id, UID: types.UID(id), - SelfLink: util.Test.SelfLink(string(v1.ResourcePods), id), + SelfLink: schedulertesting.Test.SelfLink(string(v1.ResourcePods), id), DeletionTimestamp: &deletionTimestamp, }, Spec: v1.PodSpec{ diff --git a/pkg/scheduler/util/testutil.go b/pkg/scheduler/testing/util.go similarity index 99% rename from pkg/scheduler/util/testutil.go rename to pkg/scheduler/testing/util.go index a6b613accf6..555773235ef 100644 --- a/pkg/scheduler/util/testutil.go +++ b/pkg/scheduler/testing/util.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package util +package testing import ( "fmt" diff --git a/pkg/scheduler/util/testutil_test.go b/pkg/scheduler/testing/util_test.go similarity index 99% rename from pkg/scheduler/util/testutil_test.go rename to pkg/scheduler/testing/util_test.go index 98e76902df7..e6545b00559 100644 --- a/pkg/scheduler/util/testutil_test.go +++ b/pkg/scheduler/testing/util_test.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package util +package testing import ( "encoding/json"