From f3adf499c282b2e848a70a537c1a20a43c4cdffc Mon Sep 17 00:00:00 2001 From: Patrick Ohly Date: Wed, 22 May 2024 10:59:06 +0200 Subject: [PATCH] hack/ginkgo-e2e.sh: skip S character by default, add newlines in CI We typically have plenty of skipped tests in an E2E run, which causes Ginkgo to print many S characters (one for each skipped test). This easily fills up an entire console window. Now the default is to silence that output. GINKGO_SILENCE_SKIPS=n reverts to the previous behavior. By default, Ginkgo prints all progress characters (S and o) in a single line. Buffering in Prow causes that output to occur only after the run is over, which defeats the purpose of having those characters. Now a newline is added after each character, so there is visible progress in Prow while Ginkgo runs. --- hack/ginkgo-e2e.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/hack/ginkgo-e2e.sh b/hack/ginkgo-e2e.sh index 99a44108996..6d2af018e17 100755 --- a/hack/ginkgo-e2e.sh +++ b/hack/ginkgo-e2e.sh @@ -32,8 +32,11 @@ e2e_test=$(kube::util::find-binary "e2e.test") # --- Setup some env vars. GINKGO_PARALLEL=${GINKGO_PARALLEL:-n} # set to 'y' to run tests in parallel +GINKGO_SILENCE_SKIPS=${GINKGO_SILENCE_SKIPS:-y} # set to 'n' to see S character for each skipped test +GINKGO_FORCE_NEWLINES=${GINKGO_FORCE_NEWLINES:-$( if [ "${CI:-false}" = "true" ]; then echo "y"; else echo "n"; fi )} # set to 'y' to print a newline after each S or o character CLOUD_CONFIG=${CLOUD_CONFIG:-""} + # If 'y', Ginkgo's reporter will not use escape sequence to color output. # # Since Kubernetes 1.25, the default is to use colors only when connected to @@ -158,6 +161,14 @@ if [[ "${GINKGO_TOLERATE_FLAKES}" == "y" ]]; then fi ginkgo_args+=("--flake-attempts=${FLAKE_ATTEMPTS}") +if [[ "${GINKGO_SILENCE_SKIPS}" == "y" ]]; then + ginkgo_args+=("--silence-skips") +fi + +if [[ "${GINKGO_FORCE_NEWLINES}" == "y" ]]; then + ginkgo_args+=("--force-newlines") +fi + if [[ "${GINKGO_NO_COLOR}" == "y" ]]; then ginkgo_args+=("--no-color") fi