Repository navigation
Add aggregate-coverage profile and consolidate CI coverage - #3156
Conversation
Add -Paggregate-coverage profile that runs all module tests including the JNA vs FFM comparison tests and produces a cross-module JaCoCo aggregate report in a single Maven invocation. CI workflows now use this profile on JDK 25 matrix entries, replacing the separate native-comparison.yaml workflow. Coverage uploads use always() so they run even when comparison tests fail. PR workflow job names include '(+ JNA==FFM)' suffix on JDK 25 for visibility into comparison test status.
📝 WalkthroughWalkthroughThe PR consolidates Java 25 coverage reporting by introducing conditional Maven test execution across CI workflows. When Java 25 is detected, tests run with an Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
✨ Simplify code
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3156 +/- ##
============================================
+ Coverage 54.58% 56.33% +1.75%
============================================
Files 211 212 +1
Lines 13476 13485 +9
Branches 2193 2193
============================================
+ Hits 7356 7597 +241
+ Misses 4991 4736 -255
- Partials 1129 1152 +23
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@pom.xml`:
- Around line 1029-1032: The usage note for the Maven profile
"aggregate-coverage" is misleading because the profile only takes effect when
the auto-activated "java25" profile adds "oshi-benchmark"; update the comment to
state that running "./mvnw test -Paggregate-coverage" will produce comparison
tests and an aggregate JaCoCo report only on JDK 25 (when the java25 profile
activates oshi-benchmark), and explicitly mention that on JDK 11/21 those
tests/reports will not run despite using -Paggregate-coverage.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: cd1e010a-3969-48de-bb9d-b550642d82ce
📒 Files selected for processing (7)
.github/workflows/linux.yaml.github/workflows/macos.yaml.github/workflows/native-comparison.yaml.github/workflows/pr.yaml.github/workflows/windows.yamloshi-benchmark/pom.xmlpom.xml
💤 Files with no reviewable changes (1)
- .github/workflows/native-comparison.yaml
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (12)
- GitHub Check: Codacy Static Code Analysis
- GitHub Check: Test JDK 11, windows-latest
- GitHub Check: Test JDK 25, windows-latest (+ JNA==FFM)
- GitHub Check: Test JDK 21, windows-latest
- GitHub Check: Test JDK 25, macos-latest (+ JNA==FFM)
- GitHub Check: Test JDK 25, ubuntu-latest (+ JNA==FFM)
- GitHub Check: Test JDK 11, ubuntu-latest
- GitHub Check: Test JDK 11, macos-latest
- GitHub Check: Test JDK 21, macos-latest
- GitHub Check: Test JDK 21, ubuntu-latest
- GitHub Check: Lint (Spotless, Checkstyle, ForbiddenAPIs, Javadoc)
- GitHub Check: Analyze (java)
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2026-04-06T04:45:51.516Z
Learnt from: dbwiddis
Repo: oshi/oshi PR: 3121
File: oshi-core/src/main/java/oshi/software/os/linux/LinuxOperatingSystem.java:53-53
Timestamp: 2026-04-06T04:45:51.516Z
Learning: In the oshi/oshi project, the public API is strictly limited to interfaces and classes in the `oshi`, `oshi.hardware`, and `oshi.software.os` packages. All platform-specific code under subpackages like `oshi.software.os.linux`, `oshi.hardware.platform.linux`, etc., is considered implementation detail — not public API. Do not flag changes to platform-specific classes (e.g., making `LinuxOperatingSystem` abstract, narrowing constructor visibility, adding abstract methods) as public API breaks.
Applied to files:
oshi-benchmark/pom.xml
📚 Learning: 2026-03-29T20:01:06.452Z
Learnt from: dbwiddis
Repo: oshi/oshi PR: 3014
File: oshi-core-java11/src/main/java/module-info.java:10-17
Timestamp: 2026-03-29T20:01:06.452Z
Learning: In the oshi project, `oshi-core-java25/src/main/java/module-info.java` intentionally does NOT export `oshi.util.platform.unix.freebsd`, `oshi.util.platform.unix.openbsd`, or `oshi.util.platform.unix.solaris`, because the FFM (Foreign Function & Memory) implementation only supports Windows, macOS, and Linux. This differs from `oshi-core-java11/src/main/java/module-info.java` which exports all Unix platform packages. The asymmetry is by design.
Applied to files:
oshi-benchmark/pom.xml
🔇 Additional comments (1)
oshi-benchmark/pom.xml (1)
147-157: This comment can be removed. Maven continues executing other mojos in the same phase when a test failure occurs—Surefire throwsMojoFailureException(notMojoExecutionException) on test failures, which allows the build to proceed to subsequent mojos in thetestphase. The aggregate report will be generated even if the comparison tests fail, so the Codecov uploads withalways()will have the XML file available.> Likely an incorrect or invalid review comment.
Adds a
-Paggregate-coverageMaven profile that runs all module tests (oshi-common, oshi-core, oshi-core-java25, oshi-benchmark) including the JNA vs FFM comparison tests, then produces a cross-module JaCoCo aggregate report -- all in a singlemvnw testinvocation.Changes
aggregate-coverageprofile placeholder with usage commentreport-aggregateclass resolution)report-aggregateexecution bound totestphaseaggregate-coverageprofile that setsmaven.test.skip=false-Paggregate-coverageinstead of plaintesttestas beforealways()so it runs even when comparison tests fail(+ JNA==FFM)suffix on JDK 25 for visibility-Pnative-comparisonprofile remains available for standalone CLI use.Usage
Summary by CodeRabbit