Code Coverage is an important measurement used during
development that describes the degree to which source code is tested. Jacoco is
a code coverage library for java, which is created by EclEmma team,
In this article , we will see how to configure Jacoco
with Jenkins. We will configure the
integration and we will run a maven build which will generate the test reports.
1. Install the
Jacoco plugin using the Jenkins Plugin manager
2. There is nothing to configure from the Jenkins side
on the Jacoco integration.
3. Create a Maven Job and configure the Github repo
with the test code written.
4. Select the “Record JaCoCo Coverage Report” from the
Post build action.
5. Configure the Jacoco Coverage report with the below
details,
Provide the path for
the exec files, inclusions and exclusions. Also we need to pass the path for
the source code where they are. Some example are provided in the above image.
6. Run the build and
once success we will see the below coverage report. A link will be created on
the left side of the job for accessing the details.
7. That all about the
Jenkins and Jacoco Configuration
No comments :
Post a Comment