I want to disable colors in output from tests run from postman cli, since I run them from Jenkins, and it’s only making a lot of noice in the log there.
Running “postman collection run -h” i get documentet that “–color off” will remove the colors
But when i try to run the command-line “postman collection run … --color off -e …” I do still get color-codes. Here is a small example from the generated output:
There’s been no response on this from anyone since it was requested. I have tried multiple options to remove the useless (in a log file) garbage escape codes and no options appear to remove them.
I’ve used test runners like this in the past - the typicaly output formats are far more useful, including the ones used by multiple CI/CD tools such as Azure DevOps build pipelines:
NxUnit / JUnit - an XML-based output format that renders well in modern build pipes
At a guess this is due to Postman themselves trying to force people to use the GUI rather than command line. Given that the GUI only permits 25 calls per month, a number useless for normal daily development where test suites are run at least once per day, this forces users to purchase the FULL USD $396 payment yearly.
In short: the Postman CEO or business staff deliberately crippled this function to force their users to pay a monthly fee. It’s not a bug - it’s a feature.
Is this specific to Jenkins?
It’s not a tool that I use but it looks like Jenkins interprets the table differently (based on the original screenshot)… have you tried Newman? does that produce the same?
At first glance, it looks like the final “failure”/“detail” string is the only coloring that is still being output. But if you open the output in an editor, you can see that the ascii-art-table still has all the escape sequences in it, too. E.g., having piped the --color off rendition to a file, when I open that in my editor, I can see all of the escape sequences that are still there:
Bottom line, --color off appears to be omitting some escape sequences, but not all.
For now, I do a regex replacement of [\x1b]\[\d+m with an empty string and it gets rid of these extraneous escape sequences, but it is annoying to have any escape sequences in the output when we do --color off.