Open sudansh opened 4 years ago
Possibly related to https://github.com/codeclimate/test-reporter/issues/376
@sudansh The cc-test-reporter tool supports summing the coverage files from multi repositories. We have 3 modules /app /api and /data. We call format-coverage
for each of the jacoco.xml
report files then sum-coverage
. Note this is extracted form Travis.yml file.
Don't know if it's expected or if there's a better way but I found we have to set the JACOCO_SOURCE_PATH
environment var before formatting the coverage.
- export JACOCO_SOURCE_PATH=api/src/main/java/
- ./cc-test-reporter format-coverage ./api/build/reports/jacoco/release/jacoco.xml --input-type jacoco -o coverage.api.json
- export JACOCO_SOURCE_PATH=app/src/main/java/
- ./cc-test-reporter format-coverage ./app/build/reports/jacoco/myFlavourRelease/jacoco.xml --input-type jacoco -o coverage.app.json
- export JACOCO_SOURCE_PATH=data/src/main/java/
- ./cc-test-reporter format-coverage ./data/build/reports/jacoco/release/jacoco.xml --input-type jacoco -o coverage.hstml.json
# sum the modules
- ./cc-test-reporter sum-coverage coverage.*.json -p 3 -o codeclimate.total.json
- ./cc-test-reporter upload-coverage -i codeclimate.total.json
I wonder why do we need to specify export JACOCO_SOURCE_PATH=app/src/main/java/
? Does the ./api/build/reports/jacoco/release/jacoco.xml
already has enough info about it?
I am using Jacoco to produce test results for multi module app. The modular structure for example is app/src/main/java module1/src/main/java module2/src/main/java... In the test coverage recent report, I could only see the files under app/src/main/java being tracked. How could I combine all modules?