Skip to content

Commit 35f5841

Browse files
elieser1101pohly
andauthored
accept GINKGO_FLAGS for test-e2e-node.sh (kubernetes#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 <[email protected]> * skip defaults only if label-filter not set Co-authored-by: Patrick Ohly <[email protected]> * focus and label_fiter can live together Co-authored-by: Patrick Ohly <[email protected]> * skip and label_filter can live together Co-authored-by: Patrick Ohly <[email protected]> --------- Co-authored-by: Patrick Ohly <[email protected]>
1 parent e85c72d commit 35f5841

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

build/root/Makefile

+3-1
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,9 @@ define TEST_E2E_NODE_HELP_INFO
221221
# Args:
222222
# FOCUS: Regexp that matches the tests to be run. Defaults to "".
223223
# SKIP: Regexp that matches the tests that needs to be skipped.
224-
# Defaults to "\[Flaky\]|\[Slow\]|\[Serial\]".
224+
# Defaults to "\[Flaky\]|\[Slow\]|\[Serial\]" unless LABEL_FILTER is set.
225+
# If LABEL_FILTER is set, then no tests are skipped by default.
226+
# 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.
225227
# TEST_ARGS: A space-separated list of arguments to pass to node e2e test.
226228
# Defaults to "".
227229
# RUN_UNTIL_FAILURE: If true, pass --until-it-fails=true to ginkgo so tests are run

hack/make-rules/test-e2e-node.sh

+10-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,12 @@ KUBE_PANIC_WATCH_DECODE_ERROR="${KUBE_PANIC_WATCH_DECODE_ERROR:-true}"
2929
export KUBE_PANIC_WATCH_DECODE_ERROR
3030

3131
focus=${FOCUS:-""}
32-
skip=${SKIP-"\[Flaky\]|\[Slow\]|\[Serial\]"}
32+
label_filter=${LABEL_FILTER:-""}
33+
if [ -n "${label_filter}" ]; then
34+
skip=${SKIP:-""} # No default skip when LABEL_FILTER is set.
35+
else
36+
skip=${SKIP-"\[Flaky\]|\[Slow\]|\[Serial\]"}
37+
fi
3338
# The number of tests that can run in parallel depends on what tests
3439
# are running and on the size of the node. Too many, and tests will
3540
# fail due to resource contention. 8 is a reasonable default for a
@@ -79,6 +84,10 @@ if [[ ${skip} != "" ]]; then
7984
ginkgoflags="${ginkgoflags} -skip=\"${skip}\" "
8085
fi
8186

87+
if [[ ${label_filter} != "" ]]; then
88+
ginkgoflags="${ginkgoflags} --label-filter=\"${label_filter}\" "
89+
fi
90+
8291
if [[ ${run_until_failure} == "true" ]]; then
8392
ginkgoflags="${ginkgoflags} --until-it-fails=true "
8493
fi

0 commit comments

Comments
 (0)