This repository was archived by the owner on Nov 19, 2024. It is now read-only.
CoverageNode: Fix mergePath for node created from cobertura report #547
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When a coverage node has been created from a cobertura report, the
mergePath
method was returning a wrong path if the provided local path contains any subpaths in it. Those subpaths were prepended to the local path thus doubling them in the merged path (for instance"a/b/c"
was transformed to"a/b/a/b/c"
).As a consequence,
FileCoverageNode.getPath
was returning a wrong file path which prevented any source file painting and display in the Jenkins UI.Fixes #456.
For the record, I deployed that fix to the Jenkins instance we are using in our development team and source file coverage display is now working when using cobertura reports.
The fix seems pretty harmless to me, surely not the best one but I guess other users of the plugin encountering the same bug will be happy to have the display of coverage painting on source files back as it is quite frustrating to not have it.