OpenCover tool only intercepts the last test assembly
See original GitHub issueInternally OpenCover intercepts the test alias and runs it. The problem however is that the test alias only executes once, for the last test-dll even if there are multiple assemblies found by the globber.
So when running a test runner separately all matching test assemblies are processed…
Task("Run-Unit-Tests")
.IsDependentOn("Build")
.Does(() =>
{
XUnit("./src/**/bin/" + configuration + "/*.Tests.dll");
});
But when running the same test runner within OpenCover, the same test assemblies are found but only the last one is intercepted and processed.
Task("Run-Code-Coverage")
.IsDependentOn("Build")
.Does(tool =>
{
tool.XUnit("./src/**/bin/" + configuration + "/*.Tests.dll");
},
new FilePath("./result.xml"),
new OpenCoverSettings()
);
The same behavior is observed both with MSTest and XUnit. Perhaps because both of them iterates over the collection and executes the test assemblies one by one?
Issue Analytics
- State:
- Created 8 years ago
- Comments:18 (17 by maintainers)
Top Results From Across the Web
Open Cover filters how to avoid test assembly files from ...
2 Answers. First run OpenCover without any filters. Now you can look at the XML report produced (or you can use ReportGenerator to...
Read more >Fine Code Coverage
Fine Code Coverage provides code coverage using one of 3 different coverage tools. In previous releases there were two coverage tools being utilised,...
Read more >How to Use OpenCover Tool for Measuring the Code ...
Learn the importance of evaluating code coverage and explore an example of measuring code coverage with the OpenCover tool.
Read more >Track your Test Coverage with OpenCover - Niche Software
Tests ]* -[*.IntegrationTests]* limits the results to only the assemblies that make up my application (which all start with Document ) and ...
Read more >Instructions for Authors | JAMA Network Open
Include a cover letter and complete contact information for the corresponding author (affiliation, postal/mail address, email address, and telephone number) and ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@patriksvensson Well I’ll be damn… It worked! 😃 @devlead As the XUnit2 tool seem to run fine we can leave XUnit1 as is. At least until someone else stumbles over an issue with it 😃
Thanks!
@patriksvensson yeah that would work, could be an issue if tests depend on xunit pre 1.9.2 it could potentially be some breaking changes, but worth a shot 😉 @phrusher One way would be to make the XUnit 1 alias smarter, but that would likely be served best as a separate issue non related to OpenCover.