question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Xunit included in the code coverage

See original GitHub issue

Generating the code coverage runsettings file as follows:

<?xml version="1.0" encoding="utf-8" ?>
<RunSettings>
    <DataCollectionRunSettings>
        <DataCollectors>
            <!--https://github.com/tonerdo/coverlet/blob/master/Documentation/VSTestIntegration.md-->
            <DataCollector friendlyName="XPlat code coverage">
                <Configuration>
                    <!--https://github.com/tonerdo/coverlet/blob/master/Documentation/MSBuildIntegration.md#excluding-from-coverage-->
                    <Exclude>[ARRT.Data.*]*,[*]FluentValidation*,[*]xunit*</Exclude>
                </Configuration>
            </DataCollector>
        </DataCollectors>
    </DataCollectionRunSettings>
</RunSettings>

When the report is created in Azure DevOps however, the xunit assemblies are included in the code coverage report. Why?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7

github_iconTop GitHub Comments

1reaction
MarcoRossignolicommented, Apr 10, 2020

Interesting. Whatever was done in 1.2.0 also allowed me to remove the FluentValidation exclusions (it was an external assembly I have no control over from nuget).

Yes, coverlet by design skip dll(also that comes with package) for what you don’t have source file(.cs) in local.

0reactions
xantaricommented, Apr 10, 2020

Interesting. Whatever was done in 1.2.0 also allowed me to remove the FluentValidation exclusions (it was an external assembly I have no control over from nuget).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Use code coverage for unit testing - .NET
Code coverage is a measurement of the amount of code that is run by unit tests - either lines, branches, or methods. As...
Read more >
Code Coverage In xUnit.net Unit Test Projects In Visual ...
In this tutorial, we will understand the code coverage concepts in Visual Studio 2017 Enterprise and will learn how to include and exclude ......
Read more >
NET Core unit testing code coverage - Code Samples
This sample solution includes a class library that is unit tested by two xUnit test projects. The corresponding article, use code coverage ......
Read more >
Setup Unit Testing & Code Coverage in ASP.NET Core
Open the WebAPI/Services/UserService.cs class and enable Coverage Gutters by clicking Watch in the VS Code status bar. The gutter next to the ...
Read more >
Code Coverage in VSTS with xUnit, Coverlet and ...
Coverlet is a package that can be included into your projects and generates code coverage info during build. The project states that it...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found