diff --git a/build/root/Makefile b/build/root/Makefile index af5239b3f7d..f463cd96f99 100644 --- a/build/root/Makefile +++ b/build/root/Makefile @@ -221,7 +221,9 @@ define TEST_E2E_NODE_HELP_INFO # Args: # FOCUS: Regexp that matches the tests to be run. Defaults to "". # SKIP: Regexp that matches the tests that needs to be skipped. -# Defaults to "\[Flaky\]|\[Slow\]|\[Serial\]". +# Defaults to "\[Flaky\]|\[Slow\]|\[Serial\]" unless LABEL_FILTER is set. +# If LABEL_FILTER is set, then no tests are skipped by default. +# LABEL_FILTER: Use Ginkgo labels query language to filter the tests to be run. May contain spaces and special characters (exclamation mark, vertical bar, etc.) but not quotation marks. # TEST_ARGS: A space-separated list of arguments to pass to node e2e test. # Defaults to "". # RUN_UNTIL_FAILURE: If true, pass --until-it-fails=true to ginkgo so tests are run diff --git a/hack/make-rules/test-e2e-node.sh b/hack/make-rules/test-e2e-node.sh index 1c5ca5d5459..0ef5480c4da 100755 --- a/hack/make-rules/test-e2e-node.sh +++ b/hack/make-rules/test-e2e-node.sh @@ -29,7 +29,12 @@ KUBE_PANIC_WATCH_DECODE_ERROR="${KUBE_PANIC_WATCH_DECODE_ERROR:-true}" export KUBE_PANIC_WATCH_DECODE_ERROR focus=${FOCUS:-""} -skip=${SKIP-"\[Flaky\]|\[Slow\]|\[Serial\]"} +label_filter=${LABEL_FILTER:-""} +if [ -n "${label_filter}" ]; then + skip=${SKIP:-""} # No default skip when LABEL_FILTER is set. +else + skip=${SKIP-"\[Flaky\]|\[Slow\]|\[Serial\]"} +fi # The number of tests that can run in parallel depends on what tests # are running and on the size of the node. Too many, and tests will # fail due to resource contention. 8 is a reasonable default for a @@ -79,6 +84,10 @@ if [[ ${skip} != "" ]]; then ginkgoflags="${ginkgoflags} -skip=\"${skip}\" " fi +if [[ ${label_filter} != "" ]]; then + ginkgoflags="${ginkgoflags} --label-filter=\"${label_filter}\" " +fi + if [[ ${run_until_failure} == "true" ]]; then ginkgoflags="${ginkgoflags} --until-it-fails=true " fi