-
Notifications
You must be signed in to change notification settings - Fork 52
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
[koverVerify] Projects with no tests are skipped #401
Comments
Hi, When there is cross-testing between subprojects, it is recommended to use a combined report on several projects. |
@shanshin I'm not cross-testing between subprojects. I've configured the rule to be applied to each subproject independently. I get the same result if I run |
Kover uses only tests that are declared in the same project, and does not know in advance whether any other projects can test his classes. To do this, add a dependency
so that when executing reports, the results of running tests from specified projects are taken into account. As a side effect, the report will take into account classes from the specified dependency. If there is such a possibility, then these classes can be filtered by package. |
@shanshin It has nothing to do with subprojects. Let's take the example app koverReport {
defaults {
verify {
rule {
bound {
minValue = 80
metric = kotlinx.kover.gradle.plugin.dsl.MetricType.LINE
aggregation = kotlinx.kover.gradle.plugin.dsl.AggregationType.COVERED_PERCENTAGE
}
}
}
}
} Then, running
Now, if you delete the
We can see in the output that the task was skipped because there were no tests to be executed. In my opinion, |
Perhaps a design is needed on the question of what to do if there are no tests in the project. |
Yes, I think that would make sense. |
+1 to being able to configure what to do when tests are not there. In our use case, we want a report to show 0% coverage when nothing is there so that we can post-process and track those over time. |
Closing the issue as a duplicate, you can follow the progress of the #409 task. |
Hi there,
I configured a 80% line coverage rule on some subprojects. Among these subprojects, some don't have any tests but
koverVerify
terminates successfully because Kover is skipping them:Task 'koverVerify' will be skipped because no tests were executed
As the 80% line coverage rule has not been met for these subprojects, I would have expected
koverVerify
to fail.Did I miss an option that would make it fail in this situation? If not, is this a change you would consider making to Kover?
Cheers!
The text was updated successfully, but these errors were encountered: