-
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
Tests are not executed #391
Comments
Is this an Android project by any chance (determining from the dependency "ui:mobile:xy")? If so, you need to use koverReport {
androidReports("<yourBuildVariantHere>") {
// report configuration
}
} This triggers the tests for me. The task that you need to execute then is named |
It's an android project, yes. How can I apply the kover plugin after AGP? It's currently applied in the And if I use the |
I think there is a workaround mentioned in #362 |
Still not clear to me where/what to execute in but I still get: |
Hi, |
|
I tried it also, but it didn't work, as it can't find a gradle task called |
At the moment, the most effective workflow is to apply the plugin explicitly in each project, instead of So you can explicitly specify the order of applying of plugins, e.g.
|
Okay, it's just a bit of tedious work, we have >200 modules. And that would be the next question, do we have also to add this line for each module?
Right? |
Perhaps in this case it is better to wait for fix #362.
The dependency must be specified only in project, in which the merged report will be generated At the same time, you can use |
Thanks, then I'll wait for the fix of #362. |
@vassilisimon, could you please check version |
Updated setup: build.gradle.kts (:app)
build.gradle.kts (root)
With 0.7.2 it creates now a report in But I've still 2 problems:
** Edit: If I use :app:koverXmlReportBetaPreProdDebug, then it runs all tests, but now I get:
|
It looks like this is because the tests were run only for JVM targets.
Have you added |
Yes, for all modules (build.gradle.kts (:app)):
I tried it:
but same issue:
|
Could you show the contents of the |
The content is too large, but there is no mention of We have for now a workaround for this problem:
|
With this setting, the tests run successfully and a correct report is generated? |
@shanshin Exactly. |
In this case, I think the current issue should be closed. if the specified workaround will cause any inconvenience, then it is worth create a separate issue for this. |
As it's a closed source project I can't provide more information here. At most in a private video/screen share session. But thanks for your time & help! |
I also got this error
Besides, If I apply a workaround for task I also got this weird behavior the first couple of times, that Android Studio was asking for all kinds of permissions to access stuff on my mac. EDIT: Some more info.
|
What I got today: FAILURE: Build failed with an exception.
Notice I am running I'm sorry I will add here as I go, I hope it can be somehow a bit helpful 🙏 EDIT: Ok, so I edited the workaround described by @vassilisimon to this: allprojects {
apply(plugin = rootProject.libs.plugins.kover.get().pluginId)
project.tasks.forEach {
if (it.name.contains("kover", ignoreCase = true)) {
println("calling doNotTrackState: MODULE ${project.name} TASK ${it.name}")
it.doNotTrackState("Dont support state tracking")
}
}
} And now it does disable track state on all kover's tasks. But now I have another error: EXPAND ERROR
It looks a bit more informative 🤞 |
New update: I did what the above error said to do and I managed to do everything except html report which fails with this error:
In case it helps anyone else, here's what I ended with: allprojects {
apply(plugin = rootProject.libs.plugins.kover.get().pluginId)
project.tasks.whenTaskAdded {
if (this.name.startsWith("kover", ignoreCase = true)) {
this.doNotTrackState("Dont support state tracking")
}
}
project.tasks.forEach {
if (it.name.startsWith("kover", ignoreCase = true)) {
it.doNotTrackState("Dont support state tracking")
}
if (project.name == "app" && it.name == "koverLog") {
it.mustRunAfter(rootProject.tasks.getByName("compileJava"))
it.mustRunAfter(rootProject.tasks.getByName("compileTestJava"))
it.mustRunAfter(rootProject.tasks.getByName("test"))
it.mustRunAfter(rootProject.tasks.getByName("koverLog"))
it.mustRunAfter(rootProject.tasks.getByName("koverGenerateArtifact"))
}
}
} |
Hello,
When I run :app:koverXmlReport I always get:
So also sonarqube complains:
My minimal setup:
build.gradle.kts (:app)
build.gradle.kts (root)
Do you have an idea how to trigger the tests?
The text was updated successfully, but these errors were encountered: