Skip to content

Code Coverage #120

Answered by knighthedspi
cprouveu asked this question in Q&A
Oct 12, 2023 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

I also faced the same issue and finally managed to make Jacoco work with test container.
Let me summarize my solution.
The idea is executing the Jacoco agent inside the Keycloak test container and copying the output dump file to host machine after finishing the test.
First, set up your pom file to add the Jacoco agent library

<!--   add jacoco agent  -->
<dependency>
      <groupId>org.jacoco</groupId>
      <artifactId>org.jacoco.agent</artifactId>
      <version>${jacoco.version}</version>
      <classifier>runtime</classifier>
      <scope>test</scope>
</dependency>

....

<!--   copy the jacoco agent to target build  -->
<plugin>
   <artifactId>maven-dependency-plugin</artifactId>
   <e…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@cprouveu
Comment options

Answer selected by cprouveu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants