-
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
Kover 0.7.3 Drastically coverage drop #373
Comments
AFAIR it's a bug in 0.7.0 due to how reports are filtered -- you can try replacing
with
@shanshin is on vacation right now, so please expect a delayed response |
Hi, However, it is possible to add classes and tests run results for a specific build variant to the default reports. For example, for all projects where there are Android targets, you can add the results of covering the required build variant:
|
Hello @shanshin Thanks a lot for the answer and suggestion. I have changed how I applied kover to this: allprojects {
apply(plugin = rootProject.libs.plugins.kover.get().pluginId).also {
rootProject.dependencies.add("kover", project(path))
koverReport {
if (pluginManager.hasPlugin(rootProject.libs.plugins.androidLib.get().pluginId)) {
defaults {
// adds the contents of the reports of `release` Android build variant to default reports
mergeWith("release")
}
}
filters {
excludes {
annotatedBy("com.oztechan.ccc.android.ui.compose.annotations.ThemedPreviews")
annotatedBy("androidx.compose.ui.tooling.preview.Preview")
annotatedBy("androidx.compose.runtime.Composable")
}
}
}
} But unfortunately, drastically coverage drop is still continuing. The PR in the description of the issue is also updated in case you want to take a look. |
Having same issue after updating from
And none of the exclusions were actually removed in the report. Any solutions? |
@fedor7peaks , do you have a reproducer project? |
@shanshin I just realized there I've been using outdated configuration for filters:
Instead of:
Let me re-test the coverage again and update here if any issues. |
@shanshin After re-testing it looks like there is no difference for coverage for classes/method/branches, the only difference is for line (0.4% lower)/instruction (0.5% lower) in my project, so overall decrease is not that big. |
This may be due both to the compiler version being changed, and to the fact that some bugs were fixed in the Kover agent because of which the coverage was calculated incorrectly before. |
@shanshin to give a quick heads up, for me the reason is not related to exclusions, I only excluded some annotations in 1 module. For me the issue is with Kover 0.7.0 I start not covering multiple modules entirely. |
@shanshin update, issue still continues on |
Sorry for the delayed answer. Is the problem still reproduced on the |
@shanshin still the same, and the branch is updated with latest version |
@mustafaozhan Please check if the code from all the necessary projects is included in the report and if all the tests are running. |
Hello @shanshin thank you for your message and the patch, I applied the patch. The drop was ~15% percent previously, but now it is ~25%. It can be because previously the 3 modules with build flavors are not included. It looks like I can see classes from all the modules in the merged report. But still the overall Drastically coverage drop is continuing. Btw, not related with the issue but this |
Perhaps this is because the tests were not run from all build variants, only @mustafaozhan, also, if it's convenient for you, we can add a merge with all the build variants the following forms:
|
We can add such a small change in the next release, #433. |
Is it now possible to use wildcards in the `mergeWith` function `?` and `*` and the check has become case-insensitive. Relates #373
Now it is possible to use wildcards in the `mergeWith` function `?` and `*` and the check has become case-insensitive. Relates #373
Now it is possible to use wildcards in the `mergeWith` function `?` and `*` and the check has become case-insensitive. Relates #373
Not sure if I understand the suggested change good 🤔
while
Should I wait for the upcoming changes to be implemented first ? Also, this doesn't look so natural to me ideally kover should be able to detect the necessary variants and modules regardless from the project setup |
These changes are not ready yet, they need to be further thought through.
Kover is already able to determine the build variants, however, when there are several independent Android applications in a multi-project build, there is no single correct way to match the build variants of one app configuration with the options of another app configuration. In this case, the users should help Kover "understand" what exactly from each project they wants to see in a specific report. For example, if you want all build variants with the And for another user, it may be necessary to add an build variant with a specific to default reports (for example, only That's why, Kover expects additional configuration (by |
@mustafaozhan, could you clarify, did you mean Kover to automatically add all build variants to the report? |
Yeah, let me know if I am missing some point, but coverage tools are mostly mean to calculate the all the project's coverage for the all modules and the codebase. So I would like to cover all the Kotlin classes/files. Also, I am not sure why the variants plays significant role here. If the variants don't have their specific sources, they should have both same coverages. But again excuse me if I am missing some point here I am looking from the tool perspective, I have no idea about the implementation of the coverage tools. Maybe you can check how it is done in other tools. |
In the latest versions of Gradle, it is not recommended that plugins access other projects, so you need to manually apply the plugin either in all projects or in those projects that are needed in the report. In the future, you can add a plugin application function in all subprojects, but it will still need to be called manually. About the build variants: |
In the next major release, it was decided to redo the logic of work for tasks with a short name (for example You may track the progress in task #462. |
Closed in favor of #462 |
Recently I updated kover to 0.7.3, the changes i made can be seen in this PR: Oztechan/CCC#2155
The app has many modules, some of them also git submodules, and it is also a Kotlin Multiplatform app.
While I was expecting a coverage change because kover still includes the
test
classes coverage in previous version, after the version increase coverage decreased by15.30%
When I navigate in Codecov's interface about the same PR I realise that many of my modules are not even included ie.
:adnroid:X
modules are in the coverage.:client:X
except:client:core:shared
So these missings are explaining the drastically coverage drop
Errors
no error found.
Expected behavior
The coverage should be calculated correctly and all the modules should be included.
Reproducer
Simply check the PR: Oztechan/CCC#2155, repo has also README.md file that can help you running the project.
Reports
Here is the COdecov link for the mentioned PR: https://app.codecov.io/gh/Oztechan/CCC/pull/2155/tree/backend
Environment
The text was updated successfully, but these errors were encountered: