expecto icon indicating copy to clipboard operation
expecto copied to clipboard

NUnit/JUnit summary implies no colour in output messages

Open cmeeren opened this issue 4 years ago • 5 comments

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

cmeeren avatar Mar 12 '21 07:03 cmeeren

Could you try --colours 0?

haf avatar Mar 12 '21 11:03 haf

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

cmeeren avatar Mar 12 '21 11:03 cmeeren

Yes, exactly. PR? :)

haf avatar Mar 12 '21 12:03 haf

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 avatar Mar 12 '21 12:03 cmeeren

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

image

cmeeren avatar May 01 '21 11:05 cmeeren