diff --git a/hack/ci/e2e-k8s.sh b/hack/ci/e2e-k8s.sh index a51b671d..f440d64d 100755 --- a/hack/ci/e2e-k8s.sh +++ b/hack/ci/e2e-k8s.sh @@ -22,6 +22,12 @@ set -o errexit -o nounset -o xtrace # Settings: # SKIP: ginkgo skip regex # FOCUS: ginkgo focus regex +# LABEL_FILTER: ginkgo label query for selecting tests (see "Spec Labels" in https://onsi.github.io/ginkgo/#filtering-specs) +# +# The default is to focus on conformance tests. Serial tests get skipped when +# parallel testing is enabled. Using LABEL_FILTER instead of combining SKIP and +# FOCUS is recommended (more expressive, easier to read than regexp). +# # GA_ONLY: true - limit to GA APIs/features as much as possible # false - (default) APIs and features left at defaults # FEATURE_GATES: @@ -237,9 +243,13 @@ run_tests() { printf '%s' "${fixed_coredns}" | kubectl apply -f - fi - # ginkgo regexes + # ginkgo regexes and label filter SKIP="${SKIP:-}" - FOCUS="${FOCUS:-"\\[Conformance\\]"}" + FOCUS="${FOCUS:-}" + LABEL_FILTER="${LABEL_FILTER:-}" + if [ -z "${FOCUS}" ] && [ -z "${LABEL_FILTER}" ]; then + FOCUS="\\[Conformance\\]" + fi # if we set PARALLEL=true, skip serial tests set --ginkgo-parallel if [ "${PARALLEL:-false}" = "true" ]; then export GINKGO_PARALLEL=y @@ -262,7 +272,7 @@ run_tests() { # interrupt ./hack/ginkgo-e2e.sh \ '--provider=skeleton' "--num-nodes=${NUM_NODES}" \ - "--ginkgo.focus=${FOCUS}" "--ginkgo.skip=${SKIP}" \ + "--ginkgo.focus=${FOCUS}" "--ginkgo.skip=${SKIP}" "--ginkgo.label-filter=${LABEL_FILTER}" \ "--report-dir=${ARTIFACTS}" '--disable-log-dump=true' & GINKGO_PID=$! wait "$GINKGO_PID"