microsoft / codecoverage

MIT License
78 stars 12 forks source link

VSTest Uploading .coverage files without .coverage extension #36

Closed danieloh1 closed 1 year ago

danieloh1 commented 1 year ago

Description

The coverage file uploaded by VSTest 17.6.2 and 17.6.0 is uploading without extension.

Steps to reproduce

&'C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe' D:\Workspace\Networking-nfv\out\debug-x64\GatewayBillingV3.UnitTests\GatewayBillingV3.UnitTests.dll /Platform:x64 /framework:net462 /Diag:C:\Users\danieloh\AppData\Local\Temp\VstsLocalTestRun_qoyto2hu.tsg\GatewayBillingV3.UnitTests_GatewayManager_DiagonasticsFile.log /TestCaseFilter:TestCategory=GatewayManager /ResultsDirectory:C:\Users\danieloh\AppData\Local\Temp\VstsLocalTestRun_qoyto2hu.tsg /Logger:"trx;LogFileName=Results_GatewayBillingV3.UnitTests_GatewayManager_2023-06-28_08_07_20.trx" /Settings:D:\Workspace\Networking-nfv\src\unittest\scripts\coverage.runsettings /inIsolation

Expected behavior

This should run our tests and produce a coverage file which we open using Start-Process . We aren't sure which VSTest version this started happening but noticed that at least VSTest 17.6.0 it is broken.

Below screenshot is an example from VSTest 16.11.0 (shipped with latest VS2019) image

Actual behavior

The coverage file is generated and uploaded without any extension image image

Diagnostic logs

Environment

Windows 11 VSTest 17.6.2 (version shipped with VS 17.6.4)

nohwnd commented 1 year ago

@jakubch1 Please have a look.

jakubch1 commented 1 year ago

@danieloh1 could you please share your coverage.runsettings ?

danieloh1 commented 1 year ago

Uploading our coverage.runsettings as txt file.

coveragerunsettings.txt

jakubch1 commented 1 year ago

@danieloh1 thanks. @mariam-abdulla could you please try to repro this?

danieloh1 commented 1 year ago

Was there some update to introduce a max length for the coverage file?

We investigated this issue some more and it seems like the coverage file gets uploaded properly with the extension when using a shorter coverage file name. The longer coverage names used to work without any issue but we noticed that 17.6.0 and 17.6.2 are both not uploading the coverage files with the .coverage extension when the coverage file name is long like the example provided in the uploaded coverage.runsettings (ex: GatewayBillingV3.UnitTests_GatewayManager_2023-06-29_02_15_30).

image

.coverage extension missing for long coverage file names image

.coverage extension present when using GUID instead image

mariam-abdulla commented 1 year ago

@danieloh1, I was able to reproduce this issue in 17.6.2, this is something related to the path length. However, this issue has been fixed in the latest upcoming release (17.7).

jakubch1 commented 1 year ago

@danieloh1 you can try to use some preview version from here: https://dev.azure.com/dnceng/public/_artifacts/feed/test-tools/NuGet/Microsoft.TestPlatform/versions/17.8.0-preview-23328-02 You can plug it in into your pipelines using this: https://learn.microsoft.com/en-us/azure/devops/pipelines/tasks/reference/visual-studio-test-platform-installer-v1?view=azure-pipelines