-
Notifications
You must be signed in to change notification settings - Fork 39.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ginkgo: disable color escape sequences by default when not connected to a terminal #111633
Conversation
…to a terminal This applies to all jobs using hack/ginkgo-e2e.sh. This is done because Spyglass does not render the escape sequences, making test output harder to read. It is done here because then we don't need to set GINKGO_NO_COLOR in all the different Prow job configs.
# 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)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TIL https://unix.stackexchange.com/a/401938
why only on 2? and not 0? any special reason
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because we care about the output, not the input.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(And because stderr is where fancy diagnostic output should be going as opposed to structured program output to stdout, so stderr not stdout)
/sig testing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
/approve
approving as a reasonable quick fix, but noting that failing to render escape sequences is a regression over the gubernator log viewer, and sounds like a spyglass bug
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: BenTheElder, pohly The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Even if this got fixed I would still prefer to not have the escape sequences. Directly viewing the full log (i.e. https://storage.googleapis.com/kubernetes-jenkins/pr-logs/pull/111633/pull-kubernetes-e2e-gce-100-performance/1554442569306345472/build-log.txt) also didn't support them. |
/priority important-soon |
awesome |
What type of PR is this?
/kind feature
What this PR does / why we need it:
This applies to all jobs using hack/ginkgo-e2e.sh. This is done because
Spyglass does not render the escape sequences, making test output harder to
read:
It is done here because then we don't need to set GINKGO_NO_COLOR in all the
different Prow job configs.
Special notes for your reviewer:
Discussed in #111627 (comment)
Does this PR introduce a user-facing change?
/cc @aojea