I have a multi module application “Project A”. This application is hosted in clustered app nodes using tomcat as web server. We are using Spring, Web Services as primary among many other technologies to build this.
For doing the API Automation i have another project “Project B” which test all the public API of “Project A” using rest-assured.
Both the “Project A” and “Project B” are distinctly different and hosted in different GIT location. We do the build and test using Jenkins.
Now my requirement is to get code coverage of “Project A” using “Project B”.
What I have Done till now:
A. I have installed jacoco-agent.jar in each of my app node and put the “JACOCO-ARGS” in the web server start up script.
JACOCO_OPTS=”-javaagent:/opt/itop/jacoco-agent.jar=destfile=/opt/itop/jacoco-
it.exec,output=file,append=true,jmx=true”
JAVA_OPTS=”${JAVA_OPTS} ${JACOCO_OPTS}”
B. We usually keep one node on only while looking for code coverage.
What I am getting now:
I am getting the jacoco-it.exec file generated but with very less coverage. With all the API passing i am getting only 3% coverage at max. Where as by doing manual testing we are getting more than 50%.
What I am looking for:
Is there any other step which I am missing here?
How to get max code coverage for this set up?
What is the standard I need to follow while looking for code coverage?
Source: Read More