"postman collection run ... --color off -e ..." do still output color-codes

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:

^[[90mβ”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€^[[39m^[[90m┬───────────────────^[[39m^[[90m┬───────────────────┐^[[39m
^[[90mβ”‚^[[39m ^[[90mβ”‚^[[39m executed ^[[90mβ”‚^[[39m failed ^[[90mβ”‚^[[39m
^[[90mβ”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€^[[39m^[[90m┼───────────────────^[[39m^[[90m┼────────────────────^[[39m
^[[90mβ”‚^[[39m iterations ^[[90mβ”‚^[[39m 1 ^[[90mβ”‚^[[39m 0 ^[[90mβ”‚^[[39m
^[[90mβ”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€^[[39m^[[90m┼───────────────────^[[39m^[[90m┼────────────────────^[[39m
^[[90mβ”‚^[[39m requests ^[[90mβ”‚^[[39m 2 ^[[90mβ”‚^[[39m 0 ^[[90mβ”‚^[[39m
^[[90mβ”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€^[[39m^[[90m┼───────────────────^[[39m^[[90m┼────────────────────^[[39m
^[[90mβ”‚^[[39m test-scripts ^[[90mβ”‚^[[39m 4 ^[[90mβ”‚^[[39m 0 ^[[90mβ”‚^[[39m
^[[90mβ”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€^[[39m^[[90m┼───────────────────^[[39m^[[90m┼────────────────────^[[39m
^[[90mβ”‚^[[39m prerequest-scripts ^[[90mβ”‚^[[39m 2 ^[[90mβ”‚^[[39m 0 ^[[90mβ”‚^[[39m

2 Likes

The same issue is actual for me

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.

Can you provide more detail on exactly what is showing in colour??

I just ran a basic collection and the --color off command works for me … but not sure if I’m looking at the same thing.

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?

You could raise it here as an issue:

Try to redirect your output to a file and check the file.

If it’s like my example in the start of the thread, the cells start with ^[[90m which means black, and ends with ^[[39m which means grey.

In your environment where colors can be shown, it looks like colors is off, but it’s just that the color is specified to be black

1 Like

I did create this issue: postman collection run … –color off -e …” do still output color-codes Β· Issue #11891 Β· postmanlabs/postman-app-support (github.com)

The question is not how it appears in the terminal window, but a few escape sequences are still slipping through.

For example, in Postman CLI 1.1.1 on macOS, with --color on, I see:

But with --color off:

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.