Open friscoMad opened 3 months ago
Hi,
the inheritedFrom
filter is taken into account during verification.
To deal with the problem, a reproducer project would be very helpful, with a description of the steps how to reproduce the issue.
The problem is that enabling that exclusion for some reasons makes all verification to pass even if it shouldn't. Here is a simple reproducer based on your simple example. I have only added the inheritance exclusion changed the verify rule to instructions (instead of lines) and bump to 90 (as 50 was passing as expected). It seems that with lines everything works as expected but branches or instructions are "bypassed" when inheritance exclusion is applied. single.zip
Describe the bug When using filtering by inheritance verification always pass even when the report correctly reports no covarage.
Errors
Expected behavior Verification should fail if the coverage does not comply with the rule
Reproducer I have not created a reproducer but we have this configuration:
With the
inheritedFrom
line commented the verify fails with it enabled the verify task pass, the code is the same and this happens even when the inherit expression does not match any file in the codebase.Afaik understand that the bug is present since this filtering was added as the test coverage for that feature only covers reports and not verification. After some debugging I think that the problem is in this piece of code: https://github.com/JetBrains/intellij-coverage/blob/e5cd723643bba739cb99cd73a5bfd1e945557701/reporter/src/com/intellij/rt/coverage/aggregate/Aggregator.java#L103
It is creating a copy of the project but only adding the classes to the copy so the rest of the model is empty and that includes the classInstructions that are probably needed by the verify logic down the line.
Reports If applicable, report files or screenshots.
Environment