mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 04:06:03 +00:00
Merge pull request #89106 from chendave/refactor
Decouple yaml based integration test from legacy test
This commit is contained in:
commit
5317a3160c
@ -15,6 +15,7 @@ go_library(
|
||||
importpath = "k8s.io/kubernetes/test/integration/scheduler_perf",
|
||||
deps = [
|
||||
"//staging/src/k8s.io/api/core/v1:go_default_library",
|
||||
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
|
||||
"//staging/src/k8s.io/apimachinery/pkg/labels:go_default_library",
|
||||
"//staging/src/k8s.io/apimachinery/pkg/runtime/schema:go_default_library",
|
||||
"//staging/src/k8s.io/client-go/informers/core/v1:go_default_library",
|
||||
@ -23,6 +24,7 @@ go_library(
|
||||
"//staging/src/k8s.io/component-base/metrics/legacyregistry:go_default_library",
|
||||
"//staging/src/k8s.io/component-base/metrics/testutil:go_default_library",
|
||||
"//test/integration/util:go_default_library",
|
||||
"//test/utils:go_default_library",
|
||||
"//vendor/k8s.io/klog:go_default_library",
|
||||
],
|
||||
)
|
||||
@ -32,7 +34,7 @@ go_test(
|
||||
size = "large",
|
||||
srcs = [
|
||||
"main_test.go",
|
||||
"scheduler_bench_test.go",
|
||||
"scheduler_perf_legacy_test.go",
|
||||
"scheduler_perf_test.go",
|
||||
"scheduler_test.go",
|
||||
],
|
||||
|
@ -50,8 +50,6 @@ var (
|
||||
{nodes: 600, existingPods: 10000, minPods: 1000},
|
||||
{nodes: 5000, existingPods: 5000, minPods: 1000},
|
||||
}
|
||||
testNamespace = "sched-test"
|
||||
setupNamespace = "sched-setup"
|
||||
)
|
||||
|
||||
// BenchmarkScheduling benchmarks the scheduling rate when the cluster has
|
||||
@ -524,17 +522,6 @@ func makeBasePodWithSecret() *v1.Pod {
|
||||
return basePod
|
||||
}
|
||||
|
||||
// makeBasePod creates a Pod object to be used as a template.
|
||||
func makeBasePod() *v1.Pod {
|
||||
basePod := &v1.Pod{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
GenerateName: "pod-",
|
||||
},
|
||||
Spec: testutils.MakePodSpec(),
|
||||
}
|
||||
return basePod
|
||||
}
|
||||
|
||||
func makeBasePersistentVolumeClaim() *v1.PersistentVolumeClaim {
|
||||
return &v1.PersistentVolumeClaim{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
@ -27,6 +27,7 @@ import (
|
||||
"time"
|
||||
|
||||
v1 "k8s.io/api/core/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/labels"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
coreinformers "k8s.io/client-go/informers/core/v1"
|
||||
@ -36,10 +37,13 @@ import (
|
||||
"k8s.io/component-base/metrics/testutil"
|
||||
"k8s.io/klog"
|
||||
"k8s.io/kubernetes/test/integration/util"
|
||||
testutils "k8s.io/kubernetes/test/utils"
|
||||
)
|
||||
|
||||
const (
|
||||
dateFormat = "2006-01-02T15:04:05Z"
|
||||
testNamespace = "sched-test"
|
||||
setupNamespace = "sched-setup"
|
||||
throughputSampleFrequency = time.Second
|
||||
)
|
||||
|
||||
@ -106,6 +110,17 @@ type DataItems struct {
|
||||
DataItems []DataItem `json:"dataItems"`
|
||||
}
|
||||
|
||||
// makeBasePod creates a Pod object to be used as a template.
|
||||
func makeBasePod() *v1.Pod {
|
||||
basePod := &v1.Pod{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
GenerateName: "pod-",
|
||||
},
|
||||
Spec: testutils.MakePodSpec(),
|
||||
}
|
||||
return basePod
|
||||
}
|
||||
|
||||
func dataItems2JSONFile(dataItems DataItems, namePrefix string) error {
|
||||
b, err := json.Marshal(dataItems)
|
||||
if err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user