diff --git a/test/integration/scheduler_perf/README.md b/test/integration/scheduler_perf/README.md index f1c4af4288e..0b2c07f2b26 100644 --- a/test/integration/scheduler_perf/README.md +++ b/test/integration/scheduler_perf/README.md @@ -110,9 +110,12 @@ make test-integration WHAT=./test/integration/scheduler_perf KUBE_TEST_ARGS=-use ``` Integration testing uses the same `config/performance-config.yaml` as -benchmarking. By default, workloads labeled as `integration-test` are executed -as part of integration testing. `-test-scheduling-label-filter` can be used to -change that. +benchmarking. By default, workloads labeled as `integration-test` +are executed as part of integration testing. `-test-scheduling-label-filter` can be used to +change that. -We should make each test case with `integration-test` label very small, +Running the integration tests as above will only execute the workloads labeled as `short`. + `SHORT=--short=false` variable added to the command can be used to disable this filtering. + +We should make each test case with `short` label very small, so that all tests with the label should take less than 5 min to complete. diff --git a/test/integration/scheduler_perf/config/performance-config.yaml b/test/integration/scheduler_perf/config/performance-config.yaml index ac7840200c6..ad5ba14dde3 100644 --- a/test/integration/scheduler_perf/config/performance-config.yaml +++ b/test/integration/scheduler_perf/config/performance-config.yaml @@ -1,10 +1,13 @@ # The following labels are used in this file: # - fast: short execution time, ideally less than 30 seconds # - integration-test: used to select workloads that -# run in pull-kubernetes-integration. Choosing those tests +# run in ci-kubernetes-integration-master. Choosing those tests # is a tradeoff between code coverage and overall runtime. -# We should make each test case with integration-test label very small, +# - short: used to select workloads that +# run in pull-kubernetes-integration. +# We should make each test case with short label very small, # so that all tests with the label should take less than 5 min to complete. +# They can be run using --short=true flag. # - performance: used to select workloads that run # in ci-benchmark-scheduler-perf. Such workloads # must run long enough (ideally, longer than 10 seconds) diff --git a/test/integration/scheduler_perf/scheduler_test.go b/test/integration/scheduler_perf/scheduler_test.go index a0beb47a39f..6ec8cb6212d 100644 --- a/test/integration/scheduler_perf/scheduler_test.go +++ b/test/integration/scheduler_perf/scheduler_test.go @@ -18,6 +18,8 @@ package benchmark import ( "testing" + + "k8s.io/utils/ptr" ) func TestScheduling(t *testing.T) { @@ -29,6 +31,10 @@ func TestScheduling(t *testing.T) { t.Fatal(err) } + if testing.Short() { + testSchedulingLabelFilter = ptr.To(*testSchedulingLabelFilter + ",+short") + } + for _, tc := range testCases { t.Run(tc.Name, func(t *testing.T) { for _, w := range tc.Workloads {