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

quarkus-jacoco bug in Quarkus 1.13.0 #16347

Closed
vapostolopoulos opened this issue Apr 8, 2021 · 2 comments · Fixed by #16426
Closed

quarkus-jacoco bug in Quarkus 1.13.0 #16347

vapostolopoulos opened this issue Apr 8, 2021 · 2 comments · Fixed by #16426
Labels
area/kubernetes kind/bug Something isn't working
Milestone

Comments

@vapostolopoulos
Copy link

vapostolopoulos commented Apr 8, 2021

Describe the bug

We (@chris-asl) create a simple project by running:

mvn io.quarkus:quarkus-maven-plugin:create \
    -DprojectGroupId=org.acme \
    -DprojectArtifactId=tests-with-coverage-quickstart

Then we add the jacoco dependency:

<dependency>
  <groupId>io.quarkus</groupId>
  <artifactId>quarkus-jacoco</artifactId>
  <scope>test</scope>
</dependency>

Running tests with ./mvnw clean verify we can generate the jacoco report and everything works as expected.

However when we add kubernetes client dependency

<dependency>
    <groupId>io.quarkus</groupId>
    <artifactId>quarkus-kubernetes-client</artifactId>
</dependency>

and rerun the tests they fail with build errors:

...
# root exception
Cannot process instrumented class io/fabric8/kubernetes/api/model/KubeSchema. Please supply original non-instrumented classes
...
Caused by: java.lang.IllegalStateException: java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.io.IOException: Error while instrumenting io.fabric8.kubernetes.api.model.KubeSchema.
Caused by: java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.io.IOException: Error while instrumenting io.fabric8.kubernetes.api.model.KubeSchema.
Caused by: java.lang.RuntimeException: java.io.IOException: Error while instrumenting io.fabric8.kubernetes.api.model.KubeSchema.
Caused by: java.io.IOException: Error while instrumenting io.fabric8.kubernetes.api.model.KubeSchema.
Caused by: java.lang.IllegalStateException: Cannot process instrumented class io/fabric8/kubernetes/api/model/KubeSchema. Please supply original non-instrumented classes.

The docs here https://quarkus.io/guides/tests-with-coverage#coverage-for-tests-not-using-quarkustest
mention that we should configure offline transformation when we are not using @QuarkusTest.
Although the src/test/java/org/acme/GreetingResourceTest.java is currently annottated as such.

Do we need to setup offline instrumentation when using kubernetes-client extension?

Expected behavior

Runs tests successfully and produce the jacoco report.

Actual behavior

Tests fail due to build errors:

...
# root exception
Cannot process instrumented class io/fabric8/kubernetes/api/model/KubeSchema. Please supply original non-instrumented classes
...
Caused by: java.lang.IllegalStateException: java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.io.IOException: Error while instrumenting io.fabric8.kubernetes.api.model.KubeSchema.
Caused by: java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.io.IOException: Error while instrumenting io.fabric8.kubernetes.api.model.KubeSchema.
Caused by: java.lang.RuntimeException: java.io.IOException: Error while instrumenting io.fabric8.kubernetes.api.model.KubeSchema.
Caused by: java.io.IOException: Error while instrumenting io.fabric8.kubernetes.api.model.KubeSchema.
Caused by: java.lang.IllegalStateException: Cannot process instrumented class io/fabric8/kubernetes/api/model/KubeSchema. Please supply original non-instrumented classes.

To Reproduce

Here is a project that reproduces the issue (as described above)
https://github.com/el10686/tests-with-coverage-quickstart

Steps to reproduce the behavior:

  1. git clone
  2. git checkout add-kuberbetes-client-dep
  3. ./mvnw clean verify

Configuration

Empty file

Environment (please complete the following information):

Output of uname -a or ver

Linux vanias-G5-5500 5.8.0-48-generic #54~20.04.1-Ubuntu SMP Sat Mar 20 13:40:25 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

Output of java -version

openjdk version "11.0.10" 2021-01-19
OpenJDK Runtime Environment (build 11.0.10+9-Ubuntu-0ubuntu1.20.04)
OpenJDK 64-Bit Server VM (build 11.0.10+9-Ubuntu-0ubuntu1.20.04, mixed mode, sharing)

GraalVM version (if different from Java)

Not using GraalVM

Quarkus version or git rev

1.13.0.Final

Build tool (ie. output of mvnw --version or gradlew --version)

Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
Maven home: /home/vanias/.m2/wrapper/dists/apache-maven-3.6.3-bin/1iopthnavndlasol9gbrbg6bf2/apache-maven-3.6.3
Java version: 11.0.10, vendor: Ubuntu, runtime: /usr/lib/jvm/java-11-openjdk-amd64
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "5.8.0-48-generic", arch: "amd64", family: "unix"

@vapostolopoulos vapostolopoulos added the kind/bug Something isn't working label Apr 8, 2021
@quarkus-bot
Copy link

quarkus-bot bot commented Apr 8, 2021

/cc @geoand

@geoand
Copy link
Contributor

geoand commented Apr 8, 2021

cc @stuartwdouglas

stuartwdouglas added a commit to stuartwdouglas/quarkus that referenced this issue Apr 12, 2021
Note that at present we are processing more
classes than are strictly nessesary, however
the proper fix for this requires some changes
that are part of my continous testing branch.

Fixes quarkusio#16347
@quarkus-bot quarkus-bot bot added this to the 2.0 - main milestone Apr 12, 2021
@gsmet gsmet modified the milestones: 2.0 - main, 1.13.2.Final Apr 13, 2021
gsmet pushed a commit to gsmet/quarkus that referenced this issue Apr 13, 2021
Note that at present we are processing more
classes than are strictly nessesary, however
the proper fix for this requires some changes
that are part of my continous testing branch.

Fixes quarkusio#16347

(cherry picked from commit 963358c)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/kubernetes kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants