Skip to content
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

Injection of fields like branchHits can break certain packages (e.g. Velocity) #301

Closed
alyssaruth opened this issue Feb 13, 2023 · 2 comments
Assignees
Labels
Bug Bug issue type S: in progress Status: implementing or design in process
Milestone

Comments

@alyssaruth
Copy link

Describe the bug
We use Velocity in our project (org.apache.velocity:velocity-engine-core:2.3), and enabling Kover with the default settings caused tests to fail with an exception. This same issue was reported with the IntelliJ tool here.

Errors
The specific stack trace in this instance was:

org.apache.velocity.exception.VelocityException: Could not initialize property keys deprecation map because DeprecatedRuntimeConstants.__$branchHits$__ field isn't properly named
                at app//org.apache.velocity.util.DeprecationAwareExtProperties.<clinit>(DeprecationAwareExtProperties.java:150)
                ... 54 more

Expected behavior
Ideally, enabling test coverage should have no impact on test results. However, obviously injecting these fields is fairly fundamental to what Kover is doing, so perhaps documenting it somewhere would be a good start? You could also consider maintaining a list of default files to exclude if there are commonly used dependencies with these sorts of issues. In my case, I was able to work around the problem with this config:

kover {
    filters {
        classes {
            excludes.addAll("org.apache.velocity.runtime.DeprecatedRuntimeConstants")
        }
    }
}

Environment

  • Kover Gradle Plugin version: 0.6.1
  • Gradle version: 7.5.1
  • Kotlin project type: Kotlin/JVM
@alyssaruth alyssaruth added Bug Bug issue type S: untriaged Status: issue reported but unprocessed labels Feb 13, 2023
@shanshin shanshin added S: in progress Status: implementing or design in process and removed S: untriaged Status: issue reported but unprocessed labels Feb 14, 2023
@shanshin
Copy link
Collaborator

Unfortunately, since the list of incompatible libraries is unknown in advance, they are added as incompatibilities are detected.

Also, example of an incompatible dependency #89.

@shanshin shanshin added this to the Release 0.7.0 milestone Feb 14, 2023
@shanshin
Copy link
Collaborator

Duplicates of #418

@shanshin shanshin closed this as not planned Won't fix, can't repro, duplicate, stale Jun 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Bug issue type S: in progress Status: implementing or design in process
Projects
None yet
Development

No branches or pull requests

2 participants