Integration Test Coverage with JaCoCo - Presentation Link
This is an example project showing how to generate coverage reports for integration tests run against a remote server. The server will be run in docker, and the integration tests (written in Cucumber) will hit the remote urls.
- Docker
- Maven
- JDK 8
Simple spring boot application that manages contacts and phone numbers backed by a postgres database
NOTE - requires postgres db running locally if server is running in IDE. To run, spin up a docker container just for
postgres with command
docker run -p5432:5432 -i -t postgres:9.6.7
Integration tests written with Cucumber BDD
Same as the server module, but broken into separate modules for web and persistence layer
- Build the server module and run docker image
cd server mvn clean package docker-compose build docker-compose up
- Run the integration tests (in a new terminal)
cd integration-tests mvn clean test -Pone
- Stop server (in same terminal docker-compose up was run)
Ctrl^C docker-compose down
- Examine results in integration-tests/target/coverage-report/html
- Build the server module and run docker image
cd multi-module-server mvn clean install -f modules/pom.xml mvn clean package docker-compose build docker-compose up
- Run the integration tests (in a new terminal)
cd integration-tests mvn clean test -Pmulti
- Stop server (in same terminal docker-compose up was run)
Ctrl^C docker-compose down
- Examine results in integration-tests/target/coverage-report/html