Add a filter for namespaces
See original GitHub issueDescribe the bug
Our assembly has internal .NUnit classes in the same assembly as the actual code.
To get proper code coverage reports I would like to exclude *.NUnit.* classes as they skew the metrics.
I tried this with a -classfilters:-*.NUnit.* argument but this didn’t work.
Debugging the issue, I found that the class filter is called with ClassName and not FullName
I misinterpreted that class name does not include namespace.
I managed to sort of get what I needed by using -classfilters:-*Fixture, but that doesn’t catch all test classes.
To not break existing functionality, can we add an -namespacefilters argument?
I don’t mind contributing this functionality myself.
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (8 by maintainers)
Top Results From Across the Web
How to "filter" and "format" namespaces based on the ...
I want to filter namespaces based on the annotation. I do not want namespace which has annotation as components\.gke\.io/layer=="addon" . I ...
Read more >Using namespaces vs. metadata filtering - Support
This article will discuss the advantages and disadvantages of using namespaces and metadata filtering in your application.
Read more >How to Filter Namespace in Filebeat Kubernetes: A Guide
Replace "your-namespace" with the namespace you want to filter. Step 3: Apply the Configuration. After you've made the changes, save the file ...
Read more >Microsoft.AspNetCore.Mvc.Filters Namespace
An interface for filter metadata which can create an instance of an executable filter. IFilterMetadata. Marker interface for filters handled in the MVC ......
Read more >System.Web.Mvc.Filters Namespace
Explore all classes and interfaces of the System.Web.Mvc.Filters namespace. ... Defines a filter that performs authentication. IOverrideFilter.
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 Free
Top 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

Works properly with my original filter:
-*.NUnit.*I only had suggested it based upon the one parser I was using and I didn’t want to break that functionality, not realising that it was the only parser behaving that way. Maybe you can update the documentation to say that the class filter works on the full class name including namespace.
You probably want to fix the broken parsers:
Use
string className = Path.GetFileNameWithoutExtension(fileName);instead.