Closed nohwnd closed 4 months ago
In case it helps, here's the the .CSPROJ file for V2 (which does not include TestCategory in the output file):
<Project Sdk="Microsoft.NET.Sdk">
you
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<IsPackable>false</IsPackable>
<StartupObject>PCE_StarterProject.Program</StartupObject>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.5.0" />
<PackageReference Include="MSTest.TestAdapter" Version="2.1.0" />
<PackageReference Include="MSTest.TestFramework" Version="2.1.0" />
<PackageReference Include="coverlet.collector" Version="1.2.0" />
</ItemGroup>
<ItemGroup>
<Folder Include="XML_OUTPUT\" />
</ItemGroup>
</Project>
here's the .CSPROJ file for V1, which does include TestCategory in the output file:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
<IsPackable>false</IsPackable>
<StartupObject>MSTest_Using_DotNetCore.Program</StartupObject>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
<PackageReference Include="MSTest.TestAdapter" Version="1.3.2" />
<PackageReference Include="MSTest.TestFramework" Version="1.3.2" />
</ItemGroup>
</Project>
The command line that I used to generate the .TRX file looks more-or-less like this:
"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe" bin\Debug\netcoreapp3.1\UnitTestDemo_Core3_1.dll /Logger:trx /ResultsDirectory:XML_OUTPUT
I am moving this issue to Test Platform because MSTest correctly emits the property, problem is on Test Platform side which isn't translating it into the trx.
This is a new feature and won't be implemented, we are focusing on adding new features to Testing.Platform instead. https://aka.ms/testingplatform
Originally posted by @MikePanitz-CCC in testfx-docs
Hello!
Using
MSTest.Framework
(1.3.2) and the following code:I can run the tests from the command line to generate a .TRX / .XML file that includes the following
However, when using MSTest V2 the .TRX file includes only this:
(Note the missing
TestCategory
element, and therefore the missingTestCategoryItem
child element(s).)I'd love to be able to 'tag' tests using the
TestCategory
attribute and have that attribute be accessible in the resulting .TRX file