You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using gotestsum inside GitHub actions to run some unit tests and noticed that the output is not colored per default. This is probably because gotestsum is not directly outputting to a real terminal. (Reference from fatih/color readme)
I needed to set --no-color=false to get it working which is not very intuitive.
I suggest to check for common CI environment variables like $GITHUB_ACTIONS for GitHub Actions and decide whether colored output should be enabled based on those variables.
The text was updated successfully, but these errors were encountered:
Thank you for opening this issue! I've mostly been using CircleCI to run tests, and github actions for other types of automation, so I had not noticed this yet. I believe CircleCI uses a pseudo terminal so that most commands believe they are running in a regular terminal and use color.
I like the idea of defaulting to color enabled in this environment, but I think we need to be careful to not assume all CI environments will support color. Checking if GITHUB_ACTIONS is set sounds like a good approach to me.
I am using
gotestsum
inside GitHub actions to run some unit tests and noticed that the output is not colored per default. This is probably becausegotestsum
is not directly outputting to a real terminal. (Reference from fatih/color readme)I needed to set
--no-color=false
to get it working which is not very intuitive.I suggest to check for common CI environment variables like
$GITHUB_ACTIONS
for GitHub Actions and decide whether colored output should be enabled based on those variables.The text was updated successfully, but these errors were encountered: