From 35f584187a6d1250191aa24b0dcf735350f57508 Mon Sep 17 00:00:00 2001 From: elieser pereira Date: Mon, 23 Dec 2024 22:48:10 -0300 Subject: [PATCH] accept GINKGO_FLAGS for test-e2e-node.sh (#129215) * accept GINKGO_FLAGS for test-e2e-node.sh * Update Makefile to document LABEL_FILTER * --label-filter part of ginkgoflags * Update Makefile * if label-filter then avoid skip and focus defaults * LABEL_FILTER can be empty * Update build/root/Makefile Co-authored-by: Patrick Ohly * skip defaults only if label-filter not set Co-authored-by: Patrick Ohly * focus and label_fiter can live together Co-authored-by: Patrick Ohly * skip and label_filter can live together Co-authored-by: Patrick Ohly --------- Co-authored-by: Patrick Ohly --- build/root/Makefile | 4 +++- hack/make-rules/test-e2e-node.sh | 11 ++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) 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