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

Coverlet is generating 0% coverage #1557

Closed
Oblutack opened this issue Nov 19, 2023 · 3 comments
Closed

Coverlet is generating 0% coverage #1557

Oblutack opened this issue Nov 19, 2023 · 3 comments
Labels
question This issue is a question

Comments

@Oblutack
Copy link

Oblutack commented Nov 19, 2023

I test with dotnet test using msbuild v6.0.0. It doesn't generate anything. I tried using collector and running dotnet test --collect:"XPlat Code Coverage" and it only displays zeros in the report aswell.
https://github.com/Oblutack/TS_Zadaca2

@github-actions github-actions bot added the untriaged To be investigated label Nov 19, 2023
@Bertk Bertk added waiting for customer Waiting for customer action question This issue is a question and removed untriaged To be investigated question This issue is a question labels Dec 4, 2023
@Bertk
Copy link
Collaborator

Bertk commented Dec 4, 2023

Hi, sorry but the current information is not sufficient.

We use a GitHub issue template which should be used to reduce additional question on the topic.

Observation

  • I only could find a test project Testiranje/Testiranje.csproj but it does not have a project reference for the test object
  • The XML in Testiranje/Testiranje.csproj is invalid and line 20 should be removed
  • the test project uses MSTest. We use typically xunit only.

Please find buildable and testable csproj files:
TSZadaca2.zip

Microsoft.CodeCoverage shows this in Visual Studio:

image

@Bertk
Copy link
Collaborator

Bertk commented Dec 5, 2023

Using the updated csproj files will generate code coverage output.

dotnet test --no-build -bl:test.binlog /p:CollectCoverage=true /p:CoverletOutputFormat=opencover
reportgenerator -reports:"**/*.opencover.xml" -targetdir:"artifacts\reports" - reporttypes:"Html;HtmlInline_AzurePipelines_Dark;Cobertura"
image

ReportGenerator can be used for HTML report.

image

reports.zip

@Bertk Bertk closed this as completed Dec 5, 2023
@Bertk
Copy link
Collaborator

Bertk commented Dec 5, 2023

@Bertk Bertk removed the waiting for customer Waiting for customer action label Dec 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question This issue is a question
Projects
None yet
Development

No branches or pull requests

2 participants