Skip to content

Commit

Permalink
Merge pull request kubernetes#111633 from pohly/ginkgo-no-color
Browse files Browse the repository at this point in the history
ginkgo: disable color escape sequences by default when not connected to a terminal
  • Loading branch information
k8s-ci-robot committed Aug 2, 2022
2 parents 22eab13 + 9ff8bdb commit 448e48b
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions hack/ginkgo-e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,12 @@ e2e_test=$(kube::util::find-binary "e2e.test")
GINKGO_PARALLEL=${GINKGO_PARALLEL:-n} # set to 'y' to run tests in parallel
CLOUD_CONFIG=${CLOUD_CONFIG:-""}

# If 'y', Ginkgo's reporter will not print out in color when tests are run
# in parallel
GINKGO_NO_COLOR=${GINKGO_NO_COLOR:-n}
# 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
# a terminal. That is the right choice for all Prow jobs (Spyglass doesn't
# render them properly).
GINKGO_NO_COLOR=${GINKGO_NO_COLOR:-$(if [ -t 2 ]; then echo n; else echo y; fi)}

# If 'y', will rerun failed tests once to give them a second chance.
GINKGO_TOLERATE_FLAKES=${GINKGO_TOLERATE_FLAKES:-n}
Expand Down Expand Up @@ -148,7 +151,7 @@ if [[ "${GINKGO_TOLERATE_FLAKES}" == "y" ]]; then
fi

if [[ "${GINKGO_NO_COLOR}" == "y" ]]; then
ginkgo_args+=("--noColor")
ginkgo_args+=("--no-color")
fi

# The --host setting is used only when providing --auth_config
Expand Down

0 comments on commit 448e48b

Please sign in to comment.