-
Notifications
You must be signed in to change notification settings - Fork 325
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Urgent] TRX logger produces invalid XML file #320
Comments
vstest team - any update on this issue? This is blocking our ability to get test results on our CI machine. All we get is pass/fail, with no info on what tests ran. |
cc @codito |
* Issue: #320 Fix: Replace invalid xml character with ?
@Eilon @natemcmaster : We are sanitizing the character by replacing it by "?" After the fix the trx will look like <?xml version="1.0" encoding="UTF-8"?>
<TestRun id="7efb1637-5204-4b84-9d19-205de9f42c60" name="faahmad@FAAHMAD-REL113 2017-01-31 04:23:34" runUser="FAREAST\faahmad" xmlns="http://microsoft.com/schemas/VisualStudio/TeamTest/2010">
<Times creation="2017-01-31T04:23:34.9288418-08:00" queuing="2017-01-31T04:23:34.9288418-08:00" start="2017-01-31T04:23:32.2258134-08:00" finish="2017-01-31T04:23:34.9418414-08:00" />
<TestSettings name="default" id="3fb75b39-566e-4240-9a00-13c9b459dd4a">
<Deployment runDeploymentRoot="faahmad_FAAHMAD-REL113 2017-01-31 04_23_34" />
</TestSettings>
<Results>
<UnitTestResult executionId="cfe1bba8-ca10-4635-a486-92a6fca0083a" testId="4975e323-e9af-42a2-ac66-58fde7510691" testName="XUnitTestProject1.UnitTest1.Test2(values: [[key, string with ? in it]])" computerName="FAAHMAD-REL113" duration="00:00:00.0130000" startTime="2017-01-31T04:23:34.9398416-08:00" endTime="2017-01-31T04:23:34.9398416-08:00" testType="13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b" outcome="Passed" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" relativeResultsDirectory="cfe1bba8-ca10-4635-a486-92a6fca0083a" />
<UnitTestResult executionId="cdcd7900-7710-4063-adc3-40ad5a247f73" testId="4d9c5aa4-c332-4d9a-9969-a4fb64e4867e" testName="XUnitTestProject1.UnitTest1.Test2(values: [[key2, second string with ? in it]])" computerName="FAAHMAD-REL113" duration="00:00:00.0010000" startTime="2017-01-31T04:23:34.9408436-08:00" endTime="2017-01-31T04:23:34.9408436-08:00" testType="13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b" outcome="Passed" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" relativeResultsDirectory="cdcd7900-7710-4063-adc3-40ad5a247f73" />
<UnitTestResult executionId="21259b9c-663f-4aab-a7d7-2967936ff03e" testId="e55bf2ce-7bdf-4d15-9588-e482428b961a" testName="XUnitTestProject1.UnitTest1.Test1" computerName="FAAHMAD-REL113" duration="00:00:00.0040000" startTime="2017-01-31T04:23:34.9408436-08:00" endTime="2017-01-31T04:23:34.9408436-08:00" testType="13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b" outcome="Passed" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" relativeResultsDirectory="21259b9c-663f-4aab-a7d7-2967936ff03e">
<Output>
<StdOut>Invalid char '"'
Invalid char '<'
Invalid char '>'
Invalid char '|'
Invalid char '\0'
Invalid char '\x01'
Invalid char '\x02'
Invalid char '\x03'
Invalid char '\x04'
Invalid char '\x05'
Invalid char '\x06'
Invalid char '\x07'
Invalid char '\x08'
Invalid char ' '
Invalid char '
'
Invalid char '?'
Invalid char '?'
Invalid char '
'
Invalid char '\x0e'
Invalid char '\x0f'
Invalid char '\x10'
Invalid char '\x11'
Invalid char '\x12'
Invalid char '\x13'
Invalid char '\x14'
Invalid char '\x15'
Invalid char '\x16'
Invalid char '\x17'
Invalid char '\x18'
Invalid char '\x19'
Invalid char '\x1a'
Invalid char '\x1b'
Invalid char '\x1c'
Invalid char '\x1d'
Invalid char '\x1e'
Invalid char '\x1f'
Invalid char ':'
Invalid char '*'
Invalid char '?'
Invalid char '\'
Invalid char '/'</StdOut>
</Output>
</UnitTestResult>
</Results>
<TestDefinitions>
<UnitTest name="XUnitTestProject1.UnitTest1.Test2(values: [[key, string with ? in it]])" storage="c:\users\faahmad\documents\visual studio 2017\projects\xunittestproject1\xunittestproject1\bin\debug\netcoreapp1.0\xunittestproject1.dll" id="4975e323-e9af-42a2-ac66-58fde7510691">
<Execution id="cfe1bba8-ca10-4635-a486-92a6fca0083a" />
<TestMethod codeBase="C:\Users\faahmad\Documents\visual studio 2017\Projects\XUnitTestProject1\XUnitTestProject1\bin\Debug\netcoreapp1.0\XUnitTestProject1.dll" executorUriOfAdapter="executor://xunit/VsTestRunner2" className="XUnitTestProject1.UnitTest1" name="XUnitTestProject1.UnitTest1.Test2(values: [[key, string with ? in it]])" />
</UnitTest>
<UnitTest name="XUnitTestProject1.UnitTest1.Test2(values: [[key2, second string with ? in it]])" storage="c:\users\faahmad\documents\visual studio 2017\projects\xunittestproject1\xunittestproject1\bin\debug\netcoreapp1.0\xunittestproject1.dll" id="4d9c5aa4-c332-4d9a-9969-a4fb64e4867e">
<Execution id="cdcd7900-7710-4063-adc3-40ad5a247f73" />
<TestMethod codeBase="C:\Users\faahmad\Documents\visual studio 2017\Projects\XUnitTestProject1\XUnitTestProject1\bin\Debug\netcoreapp1.0\XUnitTestProject1.dll" executorUriOfAdapter="executor://xunit/VsTestRunner2" className="XUnitTestProject1.UnitTest1" name="XUnitTestProject1.UnitTest1.Test2(values: [[key2, second string with ? in it]])" />
</UnitTest>
<UnitTest name="XUnitTestProject1.UnitTest1.Test1" storage="c:\users\faahmad\documents\visual studio 2017\projects\xunittestproject1\xunittestproject1\bin\debug\netcoreapp1.0\xunittestproject1.dll" id="e55bf2ce-7bdf-4d15-9588-e482428b961a">
<Execution id="21259b9c-663f-4aab-a7d7-2967936ff03e" />
<TestMethod codeBase="C:\Users\faahmad\Documents\visual studio 2017\Projects\XUnitTestProject1\XUnitTestProject1\bin\Debug\netcoreapp1.0\XUnitTestProject1.dll" executorUriOfAdapter="executor://xunit/VsTestRunner2" className="XUnitTestProject1.UnitTest1" name="XUnitTestProject1.UnitTest1.Test1" />
</UnitTest>
</TestDefinitions>
<TestEntries>
<TestEntry testId="4975e323-e9af-42a2-ac66-58fde7510691" executionId="cfe1bba8-ca10-4635-a486-92a6fca0083a" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" />
<TestEntry testId="4d9c5aa4-c332-4d9a-9969-a4fb64e4867e" executionId="cdcd7900-7710-4063-adc3-40ad5a247f73" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" />
<TestEntry testId="e55bf2ce-7bdf-4d15-9588-e482428b961a" executionId="21259b9c-663f-4aab-a7d7-2967936ff03e" testListId="8c84fa94-04c1-424b-9868-57a2d4851a1d" />
</TestEntries>
<TestLists>
<TestList name="Results Not in a List" id="8c84fa94-04c1-424b-9868-57a2d4851a1d" />
<TestList name="All Loaded Results" id="19431567-8539-422a-85d7-44ee4e166bda" />
</TestLists>
<ResultSummary outcome="Completed">
<Counters total="3" executed="3" passed="3" failed="0" error="0" timeout="0" aborted="0" inconclusive="0" passedButRunAborted="0" notRunnable="0" notExecuted="0" disconnected="0" warning="0" completed="0" inProgress="0" pending="0" />
</ResultSummary>
</TestRun>``` |
Certainly better than producing invalid XML. Since '?' could be a wide range of characters, it might make it hard to distinguish tests. Would it be possible to make it a readable format, like |
Thanks for your feedback. Yes we can replace invalid character with escape sequence like \uNNNN. |
Awesome! Thanks @Faizan2304. |
* Issue: microsoft#320 Fix: Replace invalid xml character with ?
* Replace invalid xml character with ? (#425) * Issue: #320 Fix: Replace invalid xml character with ? * Testhost std error messages should pass to vstest.console (#417) * Log testhost std error message if exit with error * Add exit call back before process start * add unit test and acceptance test * Address PR comments * xlf changes * Replacing invalid xml character by unicode escape character (#437) * Replace invalid xml character by unicode escape character * Add auto-generated header to generated Program (#424) Add auto-generated header comment to generated Program.cs and Program.vb files to resolve #420. * Show IFrameworkHandle.SendMessage messages from test adapters. (#429) * Change the type name of the class generated in the GenerateProgramFile target (#441) * Build TestPlatform.vsix with RC3 VSSDK tooling (#438) * Build vsix using RC3 VSSDK tooling. * Issue: https://devdiv.visualstudio.com/DefaultCollection/DevDiv/_workitems?id=366417&_a=edit Fix: Update manifest.json to have entry for all the files and theit sha256 which are going to be part of vsix. Testing: Manually validated by installing new vsix. The old folder is getting deleted after installing new one. * Fix vsix folder name in extension folder with name "TestPlatform" * Log test host standard error (#458) * Log test host standard error * Update xlf files * Update acceptance test * add 'Reason: ' prefix
Description
The TRX logger can produce invalid XML
Steps to reproduce
dotnet test --logger:trx
Expected behavior
TRX logger should sanitize the characters send to StdOut
Actual behavior
XML is invalid. Incorrect escape codes are used.
Environment
dotnet-CLI 1.0.0-preview4-004233
The text was updated successfully, but these errors were encountered: