Reputation: 1
In my project, we need to generate the jacoco report for the external tests for the application/service deployed in AWS. In local system when making the service up by running the jar using java -jar command it is working fine and when tried in AWS, the jacoco.exec file is getting generated without any data in it.
Steps which i have tried
Created a runnable jar in local for a service
Made the service up locally using the command java -javaagent:/path/to/jacocoagent.jar=destfile=/path/to/jacoco.exec -jar appName.jar
Application came up and initiated the manual/automated test cases
Using the jacococli.jar successfully generated the html report with the generated jacoco.exec
For AWS, in the docker file mentioned the below commands:
FROM openjdk:17
EXPOSE 8080
ADD build/libs/appName.jar appName.jar
ADD jacocoagent jacocoagentnew
ENTRYPOINT ["sh", "-c", "java -javaagent:/path/to/jacocoagent.jar=destfile=/path/to/jacoco.exec -jar /appName.jar"]
Created a image using dockerfile and deployed in podman desktop
In the destination path jacoco.exec is getting generated and even after hitting the requests (test cases) the file has 0 bytes of data
Upvotes: 0
Views: 25