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

Force coloring of the stdout when integrated in CI tools (eg: Gitlab) #470

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kitschyboy
Copy link

When Pabot is launched by a Gitlab runner, the output is redirected and printed in the Gitlab job console.
The current implementation of coloring in Pabot checks if Pabot runs in a terminal, and prevents the output from being colored if not (#31)

However, Gitlab supports coloring of the jobs log, and it would be interesting to be able to force the colored output: for instance, you can do it in Ansible using the environment variable ANSIBLE_FORCE_COLOR.

These is a pull request implementing this mechanism : if the environment variable PABOT_FORCE_COLOR is set to 'true' or '1', we force the output coloring, regardless of the os or redirection. I tested in our Gitlab CI and it works correctly.

Thanks in advance for your review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant