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 <patrick.ohly@intel.com>

* skip defaults only if label-filter not set

Co-authored-by: Patrick Ohly <patrick.ohly@intel.com>

* focus and label_fiter can live together

Co-authored-by: Patrick Ohly <patrick.ohly@intel.com>

* skip and label_filter can live together

Co-authored-by: Patrick Ohly <patrick.ohly@intel.com>

---------

Co-authored-by: Patrick Ohly <patrick.ohly@intel.com>
This commit is contained in:
elieser pereira 2024-12-23 22:48:10 -03:00 committed by GitHub
parent e85c72d417
commit 35f584187a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 13 additions and 2 deletions

View File

@ -221,7 +221,9 @@ define TEST_E2E_NODE_HELP_INFO
# Args: # Args:
# FOCUS: Regexp that matches the tests to be run. Defaults to "". # FOCUS: Regexp that matches the tests to be run. Defaults to "".
# SKIP: Regexp that matches the tests that needs to be skipped. # 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. # TEST_ARGS: A space-separated list of arguments to pass to node e2e test.
# Defaults to "". # Defaults to "".
# RUN_UNTIL_FAILURE: If true, pass --until-it-fails=true to ginkgo so tests are run # RUN_UNTIL_FAILURE: If true, pass --until-it-fails=true to ginkgo so tests are run

View File

@ -29,7 +29,12 @@ KUBE_PANIC_WATCH_DECODE_ERROR="${KUBE_PANIC_WATCH_DECODE_ERROR:-true}"
export KUBE_PANIC_WATCH_DECODE_ERROR export KUBE_PANIC_WATCH_DECODE_ERROR
focus=${FOCUS:-""} 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 # 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 # 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 # fail due to resource contention. 8 is a reasonable default for a
@ -79,6 +84,10 @@ if [[ ${skip} != "" ]]; then
ginkgoflags="${ginkgoflags} -skip=\"${skip}\" " ginkgoflags="${ginkgoflags} -skip=\"${skip}\" "
fi fi
if [[ ${label_filter} != "" ]]; then
ginkgoflags="${ginkgoflags} --label-filter=\"${label_filter}\" "
fi
if [[ ${run_until_failure} == "true" ]]; then if [[ ${run_until_failure} == "true" ]]; then
ginkgoflags="${ginkgoflags} --until-it-fails=true " ginkgoflags="${ginkgoflags} --until-it-fails=true "
fi fi