Chandru
Chandru

Reputation: 1

Jacoco Implementation in AWS

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

  1. Created a runnable jar in local for a service

  2. Made the service up locally using the command java -javaagent:/path/to/jacocoagent.jar=destfile=/path/to/jacoco.exec -jar appName.jar

  3. Application came up and initiated the manual/automated test cases

  4. Using the jacococli.jar successfully generated the html report with the generated jacoco.exec

  5. 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"] 
    
  6. Created a image using dockerfile and deployed in podman desktop

  7. 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

Answers (0)

Related Questions