-
Notifications
You must be signed in to change notification settings - Fork 54
Description
What is your use-case and why do you need this feature?
I would like to speed up my build by aggregating some tests into a single module. At the same time, I would like to retain the ability to check coverage of each module independently.
Imagine a project with 3 subprojects: :app, :core, and :lib. Let's say that the way things are now is that each subproject adds the kover plugin, and has its own tests. However, the overhead of running starting 3 separate test processes is too much. So, I want to only have one test test in :app, which will also test :core and :lib (3 projects is not significant overhead, but in real life there could be hundreds of subprojects).
I am looking at the newest API for creating custom variants in 8.0.0-Beta. I see in KoverVariantCreateConfig that I can create a new variant, however it doesn't seem that a variant can define its own dependencies. So here is the issue. Let's say :app adds kover depedencies on :core: and :lib. My understanding is that by default, all 3 modules code will be combined for the coverage verification rules. This means that you might be able to pass a rule even though you didn't cover a single line in :lib, because you covered enough lines in :core.
I was hoping custom variants solve this problem, but I cannot figure out how to do what I am imagining. I would like a custom variant in :app in which verification rules are only looking at a single kover dependency project, like :core.
Describe the solution you'd like
Possibly the closest thing I am finding looking at the API is KoverVariantSources.excludedSourceSets. If only there was something like KoverVariantSources.includedKoverDependencies: Set<String> in which each string was the path of a module. If empty, it could default to including all kover dependencies as well as the current project. but if we were to write includedKoverDependencies.append(':core') then that variant would analyze its rules only using the code fom :core, not even from the current project.