trautonen / coveralls-maven-plugin

Maven plugin for submitting Java code coverage reports to Coveralls web service.
MIT License
311 stars 124 forks source link

Report merging with source replaced with digest #81

Closed psiniemi closed 9 years ago

psiniemi commented 9 years ago

Switch out source in memory for the corresponding md5 digest. Upgrade java requirement to java 7.

trautonen commented 9 years ago

Wow, coveralls is picky... :)

Great work @psiniemi! I hopefully have time tonight to release 3.2.0, there's one unverified issue but I will probably release it as is, because i was able to reproduce and fix it.

Then I'll check this out and roll 4.0.0 in.

trautonen commented 9 years ago

Cleaned up and merged. And big thanks again for your effort. Btw, was there a reason for custom MD5 input stream? I managed to handle it with JDK built in solution.

@psiniemi I would be grateful to hear how it goes for your integration test project with the latest 4.0.0-SNAPSHOT. Now available in Sonatype's repo.

psiniemi commented 9 years ago

[INFO] --- coveralls-maven-plugin:3.2.0:report (default-cli) @ willow-parent --- [INFO] Starting Coveralls job in dry run mode [INFO] Using repository token [INFO] Git commit 54b4e0f in master [INFO] Writing Coveralls data to /home/pasi/src/willow/target/coveralls.json... [INFO] Processing coverage report from /home/pasi/src/willow/willow-deployer/target/site/jacoco/jacoco.xml [INFO] Processing coverage report from /home/pasi/src/willow/willow-utils/target/site/jacoco/jacoco.xml [INFO] Processing coverage report from /home/pasi/src/willow/willow-servers/target/site/jacoco/jacoco.xml [INFO] Processing coverage report from /home/pasi/src/willow/willow-servers/target/site/cobertura/coverage.xml [INFO] Processing coverage report from /home/pasi/src/willow/willow-servers/target/saga-coverage/total-coverage.xml [INFO] Successfully wrote Coveralls data in 781ms [INFO] Gathered code coverage metrics for 260 source files with 22282 lines of code: [INFO] - 9855 relevant lines [INFO] - 3911 covered lines [INFO] - 5944 missed lines [INFO] Dry run enabled, Coveralls report will NOT be submitted to API [INFO] 865161 bytes of data was recorded in /home/pasi/src/willow/target/coveralls.json

[INFO] --- coveralls-maven-plugin:4.0.0-SNAPSHOT:report (default-cli) @ willow-parent --- [INFO] Starting Coveralls job in dry run mode [INFO] Using repository token [INFO] Git commit 54b4e0f in master [INFO] Writing Coveralls data to /home/pasi/src/willow/target/coveralls.json... [INFO] Processing coverage report from /home/pasi/src/willow/willow-deployer/target/site/jacoco/jacoco.xml [INFO] Processing coverage report from /home/pasi/src/willow/willow-utils/target/site/jacoco/jacoco.xml [INFO] Processing coverage report from /home/pasi/src/willow/willow-servers/target/site/jacoco/jacoco.xml [INFO] Processing coverage report from /home/pasi/src/willow/willow-servers/target/site/cobertura/coverage.xml [INFO] Processing coverage report from /home/pasi/src/willow/willow-servers/target/saga-coverage/total-coverage.xml [INFO] Successfully wrote Coveralls data in 790ms [INFO] Gathered code coverage metrics for 334 source files with 30512 lines of code: [INFO] - 13580 relevant lines [INFO] - 5145 covered lines [INFO] - 8435 missed lines [INFO] Dry run enabled, Coveralls report will NOT be submitted to API [INFO] 115027 bytes of data was recorded in /home/pasi/src/willow/target/coveralls.json

So covered lines for the same jacoco & cobertura & saga coverage reports went up from 3911 lines to 5145 lines - which makes me happy :)

MD5Sum implementation is just something I happened to have lying around, good to know I can now throw it away ;)

trautonen commented 9 years ago

I found that the relevant line count is radically different. I guess there's a bug that calculates the line count in a source callback before the sources are flagged as unique. I have to dig this and change where the lines are calculated.

psiniemi commented 9 years ago

Yes, in fact the coveralls for 4.0.0 coveralls report has less files because some javascript files end up as duplicates in the 3.2.0 report. So the 260 files matches the number in the 3.2.0 report, but actually there are 243 unique files in the coverage reports.

psiniemi commented 9 years ago

Added my reports for these in this branch so you can compare if you like. 4.0.0 looks ok to me.

psiniemi commented 9 years ago

This report was submitted with 4.0.0-SNAPSHOT

https://coveralls.io/builds/3364198

All of the sources seem changed because I imagine that the hash they calculate from the source in the json does not match the hash from the actual file.

psiniemi commented 9 years ago

The report now matches the source after last nights changes.

[INFO] --- coveralls-maven-plugin:4.0.0-SNAPSHOT:report (default-cli) @ willow-parent ---
[INFO] Starting Coveralls job in dry run mode
[INFO] Using repository token <secret>
[INFO] Git commit 54b4e0f in master
[INFO] Writing Coveralls data to /home/pasi/src/willow/target/coveralls.json...
[INFO] Processing coverage report from /home/pasi/src/willow/willow-deployer/target/site/jacoco/jacoco.xml

[INFO] Processing coverage report from /home/pasi/src/willow/willow-utils/target/site/jacoco/jacoco.xml
[INFO] Processing coverage report from /home/pasi/src/willow/willow-servers/target/site/jacoco/jacoco.xml
[INFO] Processing coverage report from /home/pasi/src/willow/willow-servers/target/site/cobertura/coverage.xml
[INFO] Processing coverage report from /home/pasi/src/willow/willow-servers/target/saga-coverage/total-coverage.xml
[INFO] Successfully wrote Coveralls data in 1129ms
[INFO] Gathered code coverage metrics for 243 source files with 20255 lines of code:
[INFO] - 8854 relevant lines
[INFO] - 4683 covered lines
[INFO] - 4171 missed lines
[INFO] Dry run enabled, Coveralls report will NOT be submitted to API
[INFO] 115121 bytes of data was recorded in /home/pasi/src/willow/target/coveralls.json