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 (https://github.com/mkorpela/pabot/pull/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.
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 (https://github.com/mkorpela/pabot/pull/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.