I have setup jenkins on Ubuntu server 14.04 on an EC2 instance. I have some selenium tests that I execute using behave as test runner.
On Jenkins I have also installed the plugin AnsiColor hoping that I can get color output on the jenkins console, however I get color for everything else except for the Gherking syntax. Selenium errors, python debug, everything has color...except for the output of behave.
Now the thing is if I run the tests on a Mac or on Ubuntu but not with the Jenkins user, everything works fine and the colors are there.
I really don't have any code to post, but I can say what I have tried to no avail:
behave --color formatter/ansi_escapes.py
#!/bin/bashto jenkins build script to make sure it does not get executed with shinstead of bash
If this is of any relevance I am using python 3.4 on virtualenv
Besides the actual answer, any suggestions on how to debug this are also welcome! thanks
Reading original source code of PrettyFormatter, there's no way to force it to use colors as it uses isatty to determine if it's writing to actual terminal.
However, necessary modifications to enable color output are trivial:
https://github.com/mrkafk/behave/commit/5fa2dd3fd1dc7149857df4da156d8fd00f5058a5
I've created pull request and tested it to work in Jenkins (after enabling parsing ANSI codes in project configuration of course):

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With