Skip to content
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

pkg/printer: disable color output in tests #562

Merged
merged 1 commit into from
May 31, 2021

Conversation

tklauser
Copy link
Member

Depending on how go test is invoked, the auto-detection in the
github.com/fatih/color library will enable/disable color support. For
example when invoked as go test . in the pkg/printer directory,
color output will be enabled while for running go test ./... in the
root directory color support is disabled.

Avoid this flaky behavior by disabling color output in all printer
tests.

Depending on how `go test` is invoked, the auto-detection in the
`github.com/fatih/color` library will enable/disable color support. For
example when invoked as `go test .` in the `pkg/printer` directory,
color output will be enabled while for running `go test ./...` in the
root directory color support is disabled.

Avoid this flaky behavior by disabling color output in all printer
tests.

Signed-off-by: Tobias Klauser <tobias@cilium.io>
@tklauser tklauser added the release-note/misc This PR makes changes that have no direct user impact. label May 31, 2021
@tklauser tklauser requested a review from rolinh May 31, 2021 13:06
Copy link
Member

@rolinh rolinh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch!

@maintainer-s-little-helper maintainer-s-little-helper bot added the ready-to-merge This PR has passed all tests and received consensus from code owners to merge. label May 31, 2021
@rolinh rolinh merged commit 9686e86 into master May 31, 2021
@rolinh rolinh deleted the pr/tklauser/printer-disable-color-in-tests branch May 31, 2021 13:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-to-merge This PR has passed all tests and received consensus from code owners to merge. release-note/misc This PR makes changes that have no direct user impact.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants