Skip to content

Commit 09fc399

Browse files
committed
Add label to select short workloads in scheduler_perf tests
1 parent a2cd8aa commit 09fc399

File tree

3 files changed

+18
-6
lines changed

3 files changed

+18
-6
lines changed

test/integration/scheduler_perf/README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,12 @@ make test-integration WHAT=./test/integration/scheduler_perf KUBE_TEST_ARGS=-use
110110
```
111111

112112
Integration testing uses the same `config/performance-config.yaml` as
113-
benchmarking. By default, workloads labeled as `integration-test` are executed
114-
as part of integration testing. `-test-scheduling-label-filter` can be used to
115-
change that.
113+
benchmarking. By default, workloads labeled as `integration-test`
114+
are executed as part of integration testing. `-test-scheduling-label-filter` can be used to
115+
change that.
116116

117-
We should make each test case with `integration-test` label very small,
117+
Running the integration tests as above will only execute the workloads labeled as `short`.
118+
`SHORT=--short=false` variable added to the command can be used to disable this filtering.
119+
120+
We should make each test case with `short` label very small,
118121
so that all tests with the label should take less than 5 min to complete.

test/integration/scheduler_perf/config/performance-config.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
# The following labels are used in this file:
22
# - fast: short execution time, ideally less than 30 seconds
33
# - integration-test: used to select workloads that
4-
# run in pull-kubernetes-integration. Choosing those tests
4+
# run in ci-kubernetes-integration-master. Choosing those tests
55
# is a tradeoff between code coverage and overall runtime.
6-
# We should make each test case with integration-test label very small,
6+
# - short: used to select workloads that
7+
# run in pull-kubernetes-integration.
8+
# We should make each test case with short label very small,
79
# so that all tests with the label should take less than 5 min to complete.
10+
# They can be run using --short=true flag.
811
# - performance: used to select workloads that run
912
# in ci-benchmark-scheduler-perf. Such workloads
1013
# must run long enough (ideally, longer than 10 seconds)

test/integration/scheduler_perf/scheduler_test.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ package benchmark
1818

1919
import (
2020
"testing"
21+
22+
"k8s.io/utils/ptr"
2123
)
2224

2325
func TestScheduling(t *testing.T) {
@@ -29,6 +31,10 @@ func TestScheduling(t *testing.T) {
2931
t.Fatal(err)
3032
}
3133

34+
if testing.Short() {
35+
testSchedulingLabelFilter = ptr.To(*testSchedulingLabelFilter + ",+short")
36+
}
37+
3238
for _, tc := range testCases {
3339
t.Run(tc.Name, func(t *testing.T) {
3440
for _, w := range tc.Workloads {

0 commit comments

Comments
 (0)