Skip to content
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

Coverage output paths are being ignored after update to .NET 7 #28952

Closed
mfisher214 opened this issue Nov 8, 2022 · 4 comments
Closed

Coverage output paths are being ignored after update to .NET 7 #28952

mfisher214 opened this issue Nov 8, 2022 · 4 comments
Labels
untriaged Request triage from a team member

Comments

@mfisher214
Copy link

Describe the bug

Hello, I am running into an issue where after updating to .NET 7, my coverlet output path is being ignored

dotnet test command I am using:
dotnet test --no-build --configuration release /p:CollectCoverage=true /p:CoverletOutput=../CoverageResults/ /p:MergeWith="../CoverageResults/coverage.json" /p:CoverletOutputFormat="opencover,json" -m:1

After updating projects from .NET 6 to .NET 7, the coverage output paths change to the following:

Old: '/home/vsts/work/_temp/coverage/coverage.json'
New: '/home/vsts/work/1/s/tests/dotnet/(project directory)/coverage.json'

This is causing our azure pipeline builds to fail sonar test coverage tollgate because coverage files are not where they are expected to be. Is there something I'm missing here?

To Reproduce

Exceptions (if any)

Further technical details

  • .NET SDK:
    Version: 7.0.100
    Commit: e12b7af

Runtime Environment:
OS Name: Windows
OS Version: 10.0.19044
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\7.0.100\

Host:
Version: 7.0.0
Architecture: x64
Commit: d099f075e4

.NET SDKs installed:
6.0.100 [C:\Program Files\dotnet\sdk]
7.0.100 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
Microsoft.AspNetCore.App 6.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.11 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 5.0.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.0-rc.1.21451.13 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.0-rc.2.21480.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.11 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 6.0.0-rc.1.21451.3 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 6.0.0-rc.2.21501.6 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 6.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 6.0.11 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 7.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Other architectures found:
arm64 [C:\Program Files\dotnet]
registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\arm64\InstallLocation]
x86 [C:\Program Files (x86)\dotnet]
registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]

Environment variables:
Not set

global.json file:
Not found

Learn more:
https://aka.ms/dotnet/info

Download .NET:
https://aka.ms/dotnet/download

  • Visual Studio version 17.4.0
@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged Request triage from a team member label Nov 8, 2022
@dotnet-issue-labeler
Copy link

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

@nagilson
Copy link
Member

cc @Evangelink

@mfisher214
Copy link
Author

I am going to close this as I believe it is a duplicate of:
coverlet-coverage/coverlet#1391
microsoft/vstest#4014

We have followed the workaround described in above issues to use environment variables for now

@Evangelink
Copy link
Member

I agree this looks like a dup of #4014. Please feel free to revert to command line once 7.0.101 is released and keep us posted if you are still seeing any issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
untriaged Request triage from a team member
Projects
None yet
Development

No branches or pull requests

3 participants