not kotest 100% related but `Kover` . Does anyone ...
# kotest
m
not kotest 100% related but
Kover
. Does anyone know how to set up configuration in order run tests each time a coverage report task is called?
e
I think you could do something like
Copy code
tasks.withType<KoverReportTask>().configureEach {
   dependsOn(tasks.named("test"))
}
but I would ask in #gradle
j
Kover tasks are already set to run if you run the test task. Which is the use case to do the reversed flow?
m
oh nice! well I didn’t know that. In that case I wouldn’t need to do so 😄
j
Anyway I would check it with dry run and 0.7.0 alpha, as I haven’t checked if it will do the same with the new huge refactor
t
Kover tasks are already set to run if you run the test task. Which is the use case to do the reversed flow?
really? I was thinking of looking at moving from jacoco to kover because jacoco is not very precise with kotlin code, but I don’t think it’s right to run coverage every time you run tests. at least, I don’t think it’s common to run all tests all the time, that is more CI job, but if you don’t run all the tests coverage is just a waste of time
m
I asume that this is somehow configurable, can’t ensure tho
j
Gradle allow disabling tasks easily, so it is easy to disable that behavior
t
disclaimer: I did not start to look into anything yet 😄
m
I just tryed new kover 0.7, way easier to config
j
anyway I think it doesn’t consume a lot of time
could you run
./gradlew test —dry-run
so we can check if that behavior is preserved?
m
this is the only
kover
related task in the output:
Copy code
:feature:widgets:koverFindJar SKIPPED
but well eveything is
SKIPPED
IDKW
j
dry run is to know which tasks would run
but they are skipped
mmm looks like it is not running kover I think. Could you clean the reports and run test? Maybe kover runs only with check task 🤔
m
Ok let me try to clean everything and re-run
same output (sorry for the late response)
j
but without dry run
the reports are generated?
m
I doesn’t I had to generate them manually
I mean, by calling the gradle task
j
you mean you need to call the kover task manually, right?
then you should use the @Emil Kantis approach
m
KoverReportTask
not present 😕
e
Oh, I'm using Kover 0.6.x. Maybe it's changed name
j
they renamed a lot of things in 0.7.0
you have to check the migration guideline, maybe they mention it
m
wait a second
I figured out that xml reports are skipped when calling task manually but html ones are generated
Copy code
> Task :feature:widgets:koverXmlReportDevelopDebug SKIPPED
Task 'koverXmlReportDevelopDebug' will be skipped because no tests were executed
'kapt.generateStubs' is not used by the 'kotlin-kapt' plugin
j
tbh I haven’t used kover with android, so I am not sure about the behavior of kover on that land