-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add JaCoCo for Code Coverage Reports in Pass Core #107
Conversation
- Aggregate report now gathering from submodules - Add submodules metadataschema and object service
|
@markpatton @rpoet-jh Where should we put the documentation for this? Perhaps it should have it's own section in the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job, Tim. Just a couple comments.
<version>1.14.0-SNAPSHOT</version> | ||
</parent> | ||
|
||
<artifactId>jacoco-aggregate-report</artifactId> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since pass-core-main
depends on all other modules already, did you try putting this jacoco pom config (report-aggregate
) into the pass-core-main
module pom? I wonder if that may be better if it works so that we don't add another module to pass-core
? I know there has been talk about wanting to consolidate the modules into one for pass-core.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. I'd like to eventually consolidate all the pass-core modules. I don't think the separation has much point. I agree about using pass-core main if possible. In fact I was wondering if it would work in the pass root module to just cover everything.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rpoet-jh I will give this a shot and see what happens. I followed this setup from JaCoCo
From my understanding the report aggregation needs to be it's own separate module. When I originally tried doing this I tried setting the project POM to be the aggregator, but that didn't work. From my reading of the docs, if it was setup in pass-core-main
it wouldn't generate a report for pass-core-main, but would only collect from the other submodules and place the aggregated report in pass-core-main
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@markpatton @rpoet-jh This is what happens when I move the aggregation to pass-core-main
. It won't create a report for pass-core-main
. I've tried playing around with different phases, scopes, with/without the agent in pass-core-main
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, thanks for trying. When we consolidate the modules in pass-core
, we can revisit. I'm fine leaving it like this for now, @markpatton any objection?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
jacoco-aggregate-report/pom.xml
Outdated
<packaging>pom</packaging> | ||
|
||
<properties> | ||
<maven.compiler.source>23</maven.compiler.source> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pass-core
uses java 17 atm.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch. It's interesting that IntelliJ generated that even though my project is set to 17.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rpoet-jh I'm reviewing this and it seems like some modules have this property set and other do not. It looks like the majority do not have it set. Should I remove this property altogether?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually the only other POM that has it is in the pass-core-policy
submodule. And I'm assuming all this will be inherited from pass-main
POM:
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven-compiler-plugin.version}</version>
<configuration>
<release>17</release>
</configuration>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rpoet-jh I'm reviewing this and it seems like some modules have this property set and other do not. It looks like the majority do not have it set. Should I remove this property altogether?
Yeah, I think maven.compiler.source
and maven.compiler.target
should be removed. Like you said, release
will be inherited from the main pom plugin config.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed.
|
@rpoet-jh Following up from our zoom convo from earlier. I tested the question you brought up to see if report aggregation works with tests that exist in another module. Setup: The FileService tests exist in I added a test for the getFileById() exception logic with a missing ID or file name:
And it now shows it as covered in the JaCoCo Report: |
This PR will add JaCoCo (Java Code Coverage) to the pass-core project. It is mostly the default configuration for JaCoCo. The reports are aggregated into the
jacoco-aggregate-report
module. In my research this is the approach to take when setting up an aggregate report to be consumed by a report service like SonarQube.target/site/jacoco/index.html
in thejacoco-aggregate-report
moduletarget/site/jacoco/org.eclipse.pass.support.client
etc. These can be navigated to by using theindex.html
To generate the reports:
mvn verify