configure jacoco report dir if jacoco is applied
Changes
Jacoco reports cover "test" srcset by default, but they miss integrationTest srcset when using this plugin ;)
Checklist
- [x] I have tested that there is no similar pull request already submitted
- [x] I have read contributing.md and applied to the rules
- [ ] I have unit tested code changes and performed a self-review
- [ ] I have tested plugin change locally on a sample project
P.S. hi @pmendelski :))
oh, there was a kotlin update happening,
The
embedded-kotlinandkotlin-dslplugins rely on features of Kotlin1.9.24that might work differently than in the requested version2.0.20.
Hey @bgalek
First of all, sorry for being sluggish with the response. Didn't want to just merge your PR as it required loading some context.
I know that this plugin does not integrate with Jacoco, as described in the readme 😉 At the bottom, there are instructions on how to integrate.
There was also a time when such integration existed. There was a separate task jacocoIntegrationTestReport for generating coverage report for integration tests alone. I haven't used it once and didn't want to maintain most probably unused code.
In your PR, you propose to make jacocoTestReport handle unit and integration tests simultaneously. That's clear and simple but comes with some consequences:
- That would change how it already works in projects using both plugins. I'm not a fun of altering already existing mechanisms.
- For example to check coverage for unit tests only, I would need to either manually restore Jacoco default settings or make sure integrationTest.exec file is dropped - none of which is elegant.
- Jacoco plugin by default generate the coverage information (
*.execfile) for all test tasks, but does not automatically include them in the report. There must have been a reason why Jacoco authors picked this direction.
Nevertheless I agree that probably majority of projects would benefit from this integration. Before merging could you add few more changes:
- add a simple unit test to check if the integration is executed when Jacoco plugin is enabled (similar to https://github.com/coditory/gradle-integration-test-plugin/commit/e9a31b06a17bba1c9994e801bcdf7acb5b5b57c3#diff-09e7212e99be492b8500c66bdcb25b07b9f397f78a280ba3a73031603acbe432) - nothing fancy
- please do a manual test (or acceptance test, if you're feeling adventurous😄 ) to confirm the integration can be overridden manually in gradle config
- it should be also possible to not hardcode "jacoco" dir name in the path. Please check the solution from https://github.com/coditory/gradle-integration-test-plugin/commit/e9a31b06a17bba1c9994e801bcdf7acb5b5b57c3
- update readme
oh, there was a kotlin update happening,
The
embedded-kotlinandkotlin-dslplugins rely on features of Kotlin1.9.24that might work differently than in the requested version2.0.20.
When do you get this log? It sounds like an undesired state.
oh, there was a kotlin update happening,
The
embedded-kotlinandkotlin-dslplugins rely on features of Kotlin1.9.24that might work differently than in the requested version2.0.20.When do you get this log? It sounds like an undesired state.
yeah, after pulling the master branch I didn't see it again, I'll make sure that I won't introduce new warnings during testing ;)