gradle-integration-test-plugin icon indicating copy to clipboard operation
gradle-integration-test-plugin copied to clipboard

configure jacoco report dir if jacoco is applied

Open bgalek opened this issue 1 year ago • 4 comments

Changes

Jacoco reports cover "test" srcset by default, but they miss integrationTest srcset when using this plugin ;)

Checklist

P.S. hi @pmendelski :))

bgalek avatar Aug 27 '24 10:08 bgalek

oh, there was a kotlin update happening,

The embedded-kotlin and kotlin-dsl plugins rely on features of Kotlin 1.9.24 that might work differently than in the requested version 2.0.20.

bgalek avatar Aug 30 '24 10:08 bgalek

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 (*.exec file) 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

pmendelski avatar Sep 01 '24 20:09 pmendelski

oh, there was a kotlin update happening,

The embedded-kotlin and kotlin-dsl plugins rely on features of Kotlin 1.9.24 that might work differently than in the requested version 2.0.20.

When do you get this log? It sounds like an undesired state.

pmendelski avatar Sep 01 '24 20:09 pmendelski

oh, there was a kotlin update happening,

The embedded-kotlin and kotlin-dsl plugins rely on features of Kotlin 1.9.24 that might work differently than in the requested version 2.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 ;)

bgalek avatar Sep 02 '24 06:09 bgalek