mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-27 13:37:30 +00:00
Decouple yaml based integration test from legacy test
- Move utilities or constants out so that both of them should be able to run independently. - Rename the legacy test so that it can eventually be deleted when the perf dash changes is done
This commit is contained in:
parent
2f85ff5067
commit
49283364bf
@ -15,6 +15,7 @@ go_library(
|
|||||||
importpath = "k8s.io/kubernetes/test/integration/scheduler_perf",
|
importpath = "k8s.io/kubernetes/test/integration/scheduler_perf",
|
||||||
deps = [
|
deps = [
|
||||||
"//staging/src/k8s.io/api/core/v1:go_default_library",
|
"//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/labels:go_default_library",
|
||||||
"//staging/src/k8s.io/apimachinery/pkg/runtime/schema: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",
|
"//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/legacyregistry:go_default_library",
|
||||||
"//staging/src/k8s.io/component-base/metrics/testutil:go_default_library",
|
"//staging/src/k8s.io/component-base/metrics/testutil:go_default_library",
|
||||||
"//test/integration/util:go_default_library",
|
"//test/integration/util:go_default_library",
|
||||||
|
"//test/utils:go_default_library",
|
||||||
"//vendor/k8s.io/klog:go_default_library",
|
"//vendor/k8s.io/klog:go_default_library",
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
@ -32,7 +34,7 @@ go_test(
|
|||||||
size = "large",
|
size = "large",
|
||||||
srcs = [
|
srcs = [
|
||||||
"main_test.go",
|
"main_test.go",
|
||||||
"scheduler_bench_test.go",
|
"scheduler_perf_legacy_test.go",
|
||||||
"scheduler_perf_test.go",
|
"scheduler_perf_test.go",
|
||||||
"scheduler_test.go",
|
"scheduler_test.go",
|
||||||
],
|
],
|
||||||
|
@ -50,8 +50,6 @@ var (
|
|||||||
{nodes: 600, existingPods: 10000, minPods: 1000},
|
{nodes: 600, existingPods: 10000, minPods: 1000},
|
||||||
{nodes: 5000, existingPods: 5000, minPods: 1000},
|
{nodes: 5000, existingPods: 5000, minPods: 1000},
|
||||||
}
|
}
|
||||||
testNamespace = "sched-test"
|
|
||||||
setupNamespace = "sched-setup"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// BenchmarkScheduling benchmarks the scheduling rate when the cluster has
|
// BenchmarkScheduling benchmarks the scheduling rate when the cluster has
|
||||||
@ -524,17 +522,6 @@ func makeBasePodWithSecret() *v1.Pod {
|
|||||||
return basePod
|
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 {
|
func makeBasePersistentVolumeClaim() *v1.PersistentVolumeClaim {
|
||||||
return &v1.PersistentVolumeClaim{
|
return &v1.PersistentVolumeClaim{
|
||||||
ObjectMeta: metav1.ObjectMeta{
|
ObjectMeta: metav1.ObjectMeta{
|
@ -27,6 +27,7 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
v1 "k8s.io/api/core/v1"
|
v1 "k8s.io/api/core/v1"
|
||||||
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
"k8s.io/apimachinery/pkg/labels"
|
"k8s.io/apimachinery/pkg/labels"
|
||||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||||
coreinformers "k8s.io/client-go/informers/core/v1"
|
coreinformers "k8s.io/client-go/informers/core/v1"
|
||||||
@ -36,10 +37,13 @@ import (
|
|||||||
"k8s.io/component-base/metrics/testutil"
|
"k8s.io/component-base/metrics/testutil"
|
||||||
"k8s.io/klog"
|
"k8s.io/klog"
|
||||||
"k8s.io/kubernetes/test/integration/util"
|
"k8s.io/kubernetes/test/integration/util"
|
||||||
|
testutils "k8s.io/kubernetes/test/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
dateFormat = "2006-01-02T15:04:05Z"
|
dateFormat = "2006-01-02T15:04:05Z"
|
||||||
|
testNamespace = "sched-test"
|
||||||
|
setupNamespace = "sched-setup"
|
||||||
throughputSampleFrequency = time.Second
|
throughputSampleFrequency = time.Second
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -106,6 +110,17 @@ type DataItems struct {
|
|||||||
DataItems []DataItem `json:"dataItems"`
|
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 {
|
func dataItems2JSONFile(dataItems DataItems, namePrefix string) error {
|
||||||
b, err := json.Marshal(dataItems)
|
b, err := json.Marshal(dataItems)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user