-
Bug
-
Resolution: Fixed
-
Minor
-
None
-
Windows Server 2008
Jenkins 2.128
XUnit 2.0.3
We upload test results using Jenkinsfile like this:
xunit testTimeMargin: '3000', thresholdMode: 1, thresholds: [failed(), skipped()], tools: [xUnitDotNet(deleteOutputFiles: true, failIfNotNew: false, pattern: 'tests\\results\\results.xml', skipNoTestFiles: false, stopProcessingIfError: true)]
This is the content of the results.xml:
<?xml version="1.0" encoding="utf-8"?> <assemblies> <assembly name="Test.exe" environment="OS: Microsoft Windows NT 6.2.9200.0" run-date="2018-38-06" run-time="02:38:04" test-framework="Test Framework 0.1" total="1" passed="0" failed="1" skipped="0" errors="0"> <collection name="collection1" time="36.7820544" total="1" passed="0" failed="1" skipped="0"> <test name="collection1\test.xml" type="" method="" time="36.7820544" result="Fail"> <failure> <message>OK: TestProcess.Execution.ExitCode == 0
 FAIL: Output differs from reference.
 Left: data\ref
 Right: results\out
 
 </message> </failure> </test> </collection> </assembly> </assemblies>
The failure messages can be quite large for us and the newlines getting ignored makes them basically useless, thus I set this to Major priority.
Things I've tried so far:
- Enable newline escaping (we use our own framework to generate this XML in C#; note that in C# only CR gets escaped unless resorting to manual voodoo. This shouldn't be required, as LF is a valid character that should be preserved when loading by XML spec: https://www.w3.org/TR/2004/REC-xml11-20040204/#sec-line-ends ).
- Using only CR or only LF.
- Replacing newline characters with HTML <br>, <br/> tags (this probably can't work, as the text is displayed in a <pre> tag)
- Putting the message in a CDATA block and all of the above but within CDATA.
Newlines should be easier than that.