AArnott / Library.Template

A template for a NuGet package with tests, stylecop, fxcop, versioning, and Azure Pipelines build ready to go.
MIT License
131 stars 26 forks source link

Duplicate TRX files in testResults-<OSAgent> artifacts #169

Open SteveBush opened 2 years ago

SteveBush commented 2 years ago

The testResults-<OSAgent> folder contains duplicate entries for .trx logs. At the root there are .trx and diag*.log. Under <projectname>\TestResults\ there are .dmp files if they exist and duplicate .trx files.

Ideally, we could have all of the files organized by project\test pass: diag., .log, .trx, .corbertura.xml, and *.dmp files. I will open a separate issue as a feature suggestion.

See below for further clarification.

AArnott commented 2 years ago

there are three copies of a .trx file: root, <projectname>\TestResults\<GUID>\.trx, and <projectname>\TestResults\<GUID>\.trx

Your last two entries in that list are exactly the same. So... where's the third copy really?

SteveBush commented 2 years ago

I did some more digging on my local Windows Azure pipeline host (it's a pain to do this with Azure web UI). Below, is a list of trx sorted by filename.

As you can see in the second example, a duplicate trx file is being generated under

 1) <artifact_root>
 2) <artifact_root>\<subdirectory under test>\<project>\TestResults

In some cases, see the first example, a different trx file is being generated in another project under \\<project 2>\TestResults with an identical filename (bcservice_CCDEN_2022-06-20_09_46_55.trx).

There are duplicate files being generated within a project and duplicate filenames but different content across a project. I assumed these were the same content but they are unique.

I updated the issue title to reflect the duplicate files within a project.

Z:\AzureAgent\_work\7\a\testResults-Windows\windows\NetworkVisor.Platform.Test.Windows.IntegrationTests\TestResults\bcservice_CCDEN_2022-06-20_09_46_55.trx
Z:\AzureAgent\_work\7\a\testResults-Windows\windows\NetworkVisor.Platform.Test.Windows.UnitTests\TestResults\bcservice_CCDEN_2022-06-20_09_46_55.trx
Z:\AzureAgent\_work\7\a\testResults-Windows\bcservice_CCDEN_2022-06-20_09_46_55.trx

Z:\AzureAgent\_work\7\a\testResults-Windows\windows\NetworkVisor.Platform.Test.Windows.UnitTests\TestResults\bcservice_CCDEN_2022-06-20_09_47_07.trx
Z:\AzureAgent\_work\7\a\testResults-Windows\bcservice_CCDEN_2022-06-20_09_47_07.trx

Z:\AzureAgent\_work\7\a\testResults-Windows\windows\NetworkVisor.Platform.Test.Windows.UnitTests\TestResults\bcservice_CCDEN_2022-06-20_09_47_18.trx
Z:\AzureAgent\_work\7\a\testResults-Windows\bcservice_CCDEN_2022-06-20_09_47_18.trx

Z:\AzureAgent\_work\7\a\testResults-Windows\windows\NetworkVisor.Platform.Test.Windows.IntegrationTests\TestResults\bcservice_CCDEN_2022-06-20_09_47_27.trx
Z:\AzureAgent\_work\7\a\testResults-Windows\bcservice_CCDEN_2022-06-20_09_47_27.trx

Z:\AzureAgent\_work\7\a\testResults-Windows\windows\NetworkVisor.Platform.Test.Windows.UnitTests\TestResults\bcservice_CCDEN_2022-06-20_09_47_31.trx
Z:\AzureAgent\_work\7\a\testResults-Windows\bcservice_CCDEN_2022-06-20_09_47_31.trx

Z:\AzureAgent\_work\7\a\testResults-Windows\windows\NetworkVisor.Platform.Test.Windows.UnitTests\TestResults\bcservice_CCDEN_2022-06-20_09_47_42.trx
Z:\AzureAgent\_work\7\a\testResults-Windows\bcservice_CCDEN_2022-06-20_09_47_42.trx

Z:\AzureAgent\_work\7\a\testResults-Windows\windows\NetworkVisor.Platform.Test.Windows.IntegrationTests\TestResults\bcservice_CCDEN_2022-06-20_09_47_57.trx
Z:\AzureAgent\_work\7\a\testResults-Windows\windows\NetworkVisor.Platform.Test.Windows.UnitTests\TestResults\bcservice_CCDEN_2022-06-20_09_47_57.trx
Z:\AzureAgent\_work\7\a\testResults-Windows\bcservice_CCDEN_2022-06-20_09_47_57.trx

Z:\AzureAgent\_work\7\a\testResults-Windows\windows\NetworkVisor.Platform.Test.Windows.IntegrationTests\TestResults\bcservice_CCDEN_2022-06-20_09_48_26.trx
Z:\AzureAgent\_work\7\a\testResults-Windows\bcservice_CCDEN_2022-06-20_09_48_26.trx

Z:\AzureAgent\_work\7\a\testResults-Windows\windows\NetworkVisor.Platform.Test.Windows.IntegrationTests\TestResults\bcservice_CCDEN_2022-06-20_09_48_54.trx
Z:\AzureAgent\_work\7\a\testResults-Windows\bcservice_CCDEN_2022-06-20_09_48_54.trx

Z:\AzureAgent\_work\7\a\testResults-Windows\windows\NetworkVisor.Platform.Test.Windows.IntegrationTests\TestResults\bcservice_CCDEN_2022-06-20_09_49_28.trx
Z:\AzureAgent\_work\7\a\testResults-Windows\bcservice_CCDEN_2022-06-20_09_49_28.trx
AArnott commented 2 years ago

Thanks for the added detail. The redundancy in trx files has bothered me too. I'm sure we could come up with some de-dupe logic, but I wonder if filing the bug against dotnet test would be more appropriate, since that's the source of the problem and fixing it there would make a lot more people's lives a bit easier.

I updated the issue title to reflect the duplicate files within a project.

It doesn't look like you did. In GitHub you have to save a title change separately from a comment or issue description change, just FYI.

SteveBush commented 2 years ago

Updated the title correctly this time. Added issue #170 to track my suggestions on how to parse a trx file to better organize the test results artifacts.