-
Notifications
You must be signed in to change notification settings - Fork 40
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
Support deterministic Cobertuna Reports #121
base: main
Are you sure you want to change the base?
Conversation
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.
Please also add a small test case that shows that your code actually works.
|
||
return packageNode.findOrCreateFileNode(getFileName(fileName), path); | ||
var relativePath = PATH_UTIL.getRelativePath(fileName); | ||
var actualPath = relativePath.startsWith("/_/") ? |
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.
Extract "/_/"
as a constant with a meaningful name (deterministic...).
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.
can't you use String#replaceFirst
here?
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 point! I've replaced the manual prefix check with String#replaceFirst to simplify the logic
var actualFileName = (fileName != null && fileName.toString().startsWith("/_/")) ? | ||
fileName.toString().replace("/_/", "./") : | ||
(fileName != null ? fileName.toString() : relativePath); | ||
return actualFileName; |
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.
Please extract the file name logic into a method and reuse it here.
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.
👍
whats the status here? is this abandoned? |
Description
This pull request updates the file path handling in the Coverage plugin to support deterministic builds, addressing issues with paths starting with "/_/". The change ensures compatibility with Coverlet's output format, which uses these paths for deterministic reporting. This adjustment allows the plugin to properly locate and process source files, fixing the problem of missing sources in the coverage reports.
Note: This is a work in progress (WIP) PR. The implementation is still being finalized, and additional testing and adjustments are ongoing.
Testing Done
Automated Tests:
Manual Testing:
Submitter Checklist