-
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
Ability to create custom report variant for specific dependency project #584
Comments
Hi, Suppose you have |
Hey, sure I will clarify. Let's say I just have I want to only have on test source set in For kover, lets say I want these two rules:
If each module has its own test source set, this is easy. This is how my real life project works now. When I move the tests from All of what I said above is my understanding on how it works, but I did not fully test this. It is somewhat of an assumption based on how I understood the documentation, so please let me know if I am misunderstanding. |
Please correct me if I made a mistake somewhere:
You want to verify coverage only for |
Almost. In my example, When I execute When I execute The main issue is that I need verification rules to apply to each module separately. When Kover calculates whether or not 50% of the lines of ccode in At the same time, |
It looks like project filters can be added:
|
good idea. I think it would work! |
Implemented in |
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
addskover
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 likeKoverVariantSources.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 writeincludedKoverDependencies.append(':core')
then that variant would analyze its rules only using the code fom:core
, not even from the current project.The text was updated successfully, but these errors were encountered: