haf / expecto

A smooth testing lib for F#. APIs made for humans! Strong testing methodologies for everyone!
Apache License 2.0
663 stars 96 forks source link

NUnit/JUnit summary implies no colour in output messages #410

Open cmeeren opened 3 years ago

cmeeren commented 3 years ago

Repro solution in case you need it: ExpectoTest.zip

When running with --nunit-summary, the output contains an ESC character. This causes the Azure Pipelines "Publish Test Results" task to fail:

##[warning]Failed to read D:\a\1\a\TestResults.xml. Error : '', hexadecimal value 0x1B, is an invalid character. Line 7, position 1.. 

Please see the attached test results file.

TestResults.zip

Here is how the file looks in Notepad++. You can see the invalid character on lines 7 and 8.

image


The same thing happens with --junit-summary:

##[warning]Failed to read D:\a\1\s\TestResults.xml. Error : '', hexadecimal value 0x1B, is an invalid character. Line 6, position 293..

TestResults.zip

image

haf commented 3 years ago

Could you try --colours 0?

cmeeren commented 3 years ago

Yep, that solves it. I guess Expecto should always exclude colors from the test results file?

haf commented 3 years ago

Yes, exactly. PR? :)

cmeeren commented 3 years ago

Terribly sorry, I'm completely swamped and have no capacity to ramp up on a new codebase. (I have even just had to withdraw from some OSS projects I maintain.)

cmeeren commented 3 years ago

By the way, colors in the string is also an issue in the VS debugger (when debugging tests with F5):

image