-
Notifications
You must be signed in to change notification settings - Fork 47
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
[BUG] exclusions don't work (as described in the documentation) #370
Comments
Update: I just tested that excluding kover {
filters {
classes {
excludes += "com.example.TestClass2"
}
}
} This actually removes So far, this is the only exclusion mechanism that has worked for me. I still don't know why the exclusion by annotation does not work. |
Please try |
I now tried the koverReport {
filters {
excludes {
annotatedBy("*Generated")
}
}
} I also tried I'm still getting the same results. Declarations annotated with |
@RaphaelTarita, this is a lack of documentation.
|
Describe the bug
I cannot get any kind of excluding filter to work, at least not the way the documentation explains it. I am not aware of any other way of configuring filters, so I don't know if filters just generally don't work or if I'm doing something wrong. Basically, no matter what kind of exclusions I define in the
kover
configuration, they all get ignored and everything lands in the final HTML report.Expected behavior
I'm specifically trying to exclude declarations annotated with
javax.annotation.processing.Generated
, and I'd expect that those declarations would not show up in the HTML report.Reproducer
I tried this in a new, minimal gradle/kotlin project for reproduction. Here's the
build.gradle.kts
:In this project, I have two classes residing in the package root
com.example
:TestClass1.kt:
TestClass2.kt:
Then, in my test sources (also under
com.example
), I have this Kotest test class.TestClass1Tests.kt:
this only tests and covers
TestClass1
, so without further configuration it would be expected thatTestClass2
shows up uncovered in the HTML report. However, since thekover
config in the buildscript should exclude all declarations annotated withjavax.annotation.processing.Generated
, I would expectTestClass2
to not show up in the report, and therefore to have a coverage of 100%.Reports
Instead, I get a report that looks like this:
In particular, the package shows
TestClass1
fully covered andTestClass2
not covered:I don't know if my configuration is simply wrong or if I'm missing something, but simply going off from the documentation I had expected this to work. Any help appreciated!
Environment
The text was updated successfully, but these errors were encountered: