diff --git a/test/integration/scheduler/scoring/main_test.go b/test/integration/scheduler/scoring/main_test.go new file mode 100644 index 00000000000..7bf07d9e0c6 --- /dev/null +++ b/test/integration/scheduler/scoring/main_test.go @@ -0,0 +1,27 @@ +/* +Copyright 2022 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package scoring + +import ( + "testing" + + "k8s.io/kubernetes/test/integration/framework" +) + +func TestMain(m *testing.M) { + framework.EtcdMain(m.Run) +} diff --git a/test/integration/scheduler/priorities_test.go b/test/integration/scheduler/scoring/priorities_test.go similarity index 96% rename from test/integration/scheduler/priorities_test.go rename to test/integration/scheduler/scoring/priorities_test.go index 08d84c4be9d..52e5580b214 100644 --- a/test/integration/scheduler/priorities_test.go +++ b/test/integration/scheduler/scoring/priorities_test.go @@ -14,13 +14,14 @@ See the License for the specific language governing permissions and limitations under the License. */ -package scheduler +package scoring import ( "context" "fmt" "strings" "testing" + "time" v1 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" @@ -42,8 +43,27 @@ import ( "k8s.io/utils/pointer" ) +// imported from testutils +var ( + runPausePod = testutils.RunPausePod + createAndWaitForNodesInCache = testutils.CreateAndWaitForNodesInCache + createNode = testutils.CreateNode + createNamespacesWithLabels = testutils.CreateNamespacesWithLabels + runPodWithContainers = testutils.RunPodWithContainers + initPausePod = testutils.InitPausePod + initPodWithContainers = testutils.InitPodWithContainers + podScheduledIn = testutils.PodScheduledIn + podUnschedulable = testutils.PodUnschedulable +) + +var ( + hardSpread = v1.DoNotSchedule + softSpread = v1.ScheduleAnyway +) + const ( - resourceGPU = "example.com/gpu" + resourceGPU = "example.com/gpu" + pollInterval = 100 * time.Millisecond ) // This file tests the scheduler priority functions.