Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/praveengnair/jacoco-multi-module-sample
This is an example of multi modular maven project with jacoco coverage for unit, integration and functional testing and generating a merged final report in jacoco.
https://github.com/praveengnair/jacoco-multi-module-sample
cucumber jacoco jacoco-plugin java karate maven testing
Last synced: 2 months ago
JSON representation
This is an example of multi modular maven project with jacoco coverage for unit, integration and functional testing and generating a merged final report in jacoco.
- Host: GitHub
- URL: https://github.com/praveengnair/jacoco-multi-module-sample
- Owner: PraveenGNair
- License: apache-2.0
- Created: 2020-05-23T11:34:45.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-05-06T23:39:03.000Z (over 1 year ago)
- Last Synced: 2023-05-07T00:24:29.253Z (over 1 year ago)
- Topics: cucumber, jacoco, jacoco-plugin, java, karate, maven, testing
- Language: Java
- Size: 22.5 KB
- Stars: 4
- Watchers: 2
- Forks: 12
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Jacoco coverage for Multi Module Maven Project
## Overview
>A sample multi-modular maven project demonstrating how to met coverage for unit, integration and/or functional testing withing different modules.
>The test results is aggregated by Jacoco plugin and a merged code coverage report is being generated.
>The detailed blog and instructions of the project is described in [blog](https://medium.com/@prgnr173/merging-integration-unit-and-functional-test-reports-with-jacoco-de5cde9b56e1).## Run Command
>Jacoco data file location - baseDir / module3 / target / aggregate.exec
>Jacoco report location - baseDir / module3 / target / site / jacoco-aggregate / index.html
- Unit testing + jacoco reporting.
_Note: Set a lower Coverage ratio in pom.xml_`$ mvn clean install`
- Integration testing + jacoco reporting.
_Note: Set a lower Coverage ratio in pom.xml_`$ mvn clean install -P integration-test`
-Unit + Integration testing + jacoco merged reporting.
`$ mvn clean install -P testAll`
_Note: You may add additional configuration for jacoco and control the behaviour. For additional configuration details visit [here.](https://www.eclemma.org/jacoco/trunk/doc/maven.html)_# Result:
The below test coverage report shows coverage for `testAll` profile.
The other important point to consider here is we have tried to increase the coverage of module1 method `concatenation` from module3 by running cucumber tests. Cucumber tests can easily be replaced by any other functional test frameworks like Karate API Testing Framework.![Coverage Report All](merged-coverage-report-all.png)