microsoft / testfx

MSTest framework and adapter
MIT License
697 stars 250 forks source link

TRX file: <ResultFiles> not under node <UnitTestResult>, but under <Output> node #3260

Closed baumheld closed 1 month ago

baumheld commented 1 month ago

Describe the bug

During my testing for our migration from MSTest meta nuget package to the new MSTest SDK, I noticed that Azure DevOps doesn't upload files anymore, which were added via MSTests TestContext.AddResultFile(myPath) method. It works when not using the new MSTest SDK. I found that the resulting .trx file has a slight change in where the node <ResultFiles> is placed.

Expected behavior

Actual behavior

Additional context

I tried different settings and combinations in my Directory.Build.props. But they have no impact on the described bug. I also tried to change (and shorten) the local folder which is used to save the files. But also no success.

  <PropertyGroup Condition="$(MSBuildProjectName.EndsWith('Tests'))">
    <TestingPlatformDotnetTestSupport>true</TestingPlatformDotnetTestSupport>
    <TestingExtensionsProfile>Default</TestingExtensionsProfile>
    <TestingPlatformShowTestsFailure>true</TestingPlatformShowTestsFailure>
    <TestingPlatformCaptureOutput>false</TestingPlatformCaptureOutput>
  </PropertyGroup>

I noticed another odd behavior, but I'm not sure if it is related. As you can see in the attached trx-files: The same test got way more entries now. The test itself didn't change. But each test (one test per datarow) gets all the resultfiles from the other datarows attached. But before examining this, I want to wait until the above bug is resolved

Complete trx files