-
Notifications
You must be signed in to change notification settings - Fork 305
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
Development
: Fix missing source files in Jacoco report
#10343
Conversation
WalkthroughThe changes update the configuration of the Jacoco report task in the Gradle build file. The Changes
Possibly related PRs
Suggested labels
Suggested reviewers
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
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.
Actionable comments posted: 0
🧹 Nitpick comments (1)
gradle/jacoco.gradle (1)
161-166
: Refactor Class Path Determination.
For aggregated modules, theclassPath
is now set to"$BasePath/**/*.class"
, and for individual modules it is set to"$BasePath/$moduleName/**/*.class"
. This refactoring clarifies the file matching pattern. Please double-check that the value ofBasePath
correctly points to the expected source directory (e.g."src/main/java"
) per the PR objectives.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
gradle/jacoco.gradle
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (8)
- GitHub Check: Call Build Workflow / Build and Push Docker Image
- GitHub Check: Call Build Workflow / Build .war artifact
- GitHub Check: Codacy Static Code Analysis
- GitHub Check: client-style
- GitHub Check: client-tests
- GitHub Check: server-style
- GitHub Check: server-tests
- GitHub Check: Analyse
🔇 Additional comments (3)
gradle/jacoco.gradle (3)
157-159
: Inherit Task Properties from Root Task.
The changes on these lines assign thegroup
andexecutionData
properties from therootTask
to the current task. This enhances consistency by ensuring that the Jacoco report tasks inherit configuration centrally.
167-167
: Align Source Directories with Root Task.
Assigningtask.sourceDirectories
fromrootTask.sourceDirectories
ensures that the correct source files are used for the Jacoco report, addressing the issue of missing source files in the report output.
170-173
: Update Class Directories Inclusion Filter.
By updating theincludes
property to use the computedclassPath
, the report now properly filters class files based on the module context while excluding directories as defined inignoredDirectories
. This should help resolve the missing source file problem in the Jacoco report.
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.
Nice, thanks for fixing this! Test and code
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.
Code + Test
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.
tested locally and worked as expected
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.
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.
tested, thanks for fixing!
Checklist
General
Motivation and Context
The Jacoco report did not pick up the correct source files as the path was wrong (should be "src/main/java" instead of including any specific sub-path.
Description
Changes the sourceDirectories to be the exact same one coming from the root task.
Also, use the group and execution data from the rootTask instead of defining explicitly.
Steps for Testing
Coverage Report Server Tests
)Source file ... was not found during generation of report
. You cannot click on any methods.Coverage Report Server Tests
)Review Process
Code Review
Manual Tests
Screenshots
Before:

After:


Clicking on a single file: