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
fix cobertura report #571
fix cobertura report #571
Conversation
Hey @coreyfarrell, who should I include here to move things forward? I know that the team is not that familiar with cobertura. I referenced the issue that should be closed by this. @coderica perhaps you cloud have a look as well? |
Any updates here? It would be great to get that merged. :-) |
FYI I'm currently using this patch to provide Cobertura report in one of my projects, and it works correctly. |
Thanks for the input @saboya! |
I am suspecting that Jenkins is reporting 0% coverage due to the lack of |
I am pretty sure that I covered this case with my test cases as well. But it is impossible to be certain as #382 did not include a test case or the code the issue was based on. ;-) |
@Swiftwork I should have read your comment properly... |
@Swiftwork perhaps you could also test the merged code in your case and add the result to this discussion? It would be nice to see if it really fixes your issue as well and would probably add even more confidence after the #382 issue. |
@bitcloud I might get a chance on Monday, but I can confirm that when I added another folder with tests and both packages/classes tags were added, Jenkins started reporting my coverage correctly. |
As you were just active, cloud you have a look here as well @coreyfarrell? |
I don't have the capability to review anything for cobertura. We simply don't have time to go back and forth - last fix we got to this report broke other users and we had to do a second release to revert the first fix. I'm beginning to wonder if the best thing for this report is for it to be republished by the community in a stand-alone module. |
@bitcloud I'm pitching in and coming back to some old PRs. I've made it easier to release/rollback libraries from this mono-repo, so am more open to landing updates to some of these more finicky parts of the codebase. Would you be open to rebasing? |
- stable column with for all fixtures - added expected cobertura result
- add cobertura testcase - make cobertura reporter testable (consistant output)
Not sure if @bitcloud is still interested in this, but I rebased his commits in a fork: https://github.com/saboya/istanbuljs/tree/develop/fix-cobertura-report |
127a84b
to
52305e8
Compare
thx @saboya. To stay in this PR I just pushed your rebase in here as well. |
const isWindows = require('is-windows'); | ||
const FileWriter = require('istanbul-lib-report/lib/file-writer'); | ||
const istanbulLibReport = require('istanbul-lib-report'); | ||
const istanbulLibCoverage = require('istanbul-lib-coverage'); |
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.
thank you for adding a test for cobertura 🎉
Your welcome! Thanks for Maintaining! |
@bcoe Not a huge project, but a personal project of mine on Azure pipelines using cobertura to report code coverage, using the new |
The cobertura reporter currently only works if it generates coverage for script files in multiple folders. If all script files are in one folder there is no package which results in not generating the right xml structure in the reports file.
To fix this I add all files in a currently called
main
package to collect all files residing in a single folder project. I'm still unsure about the naming, cloud beroot
as well, but I thinkmain
works quite well.This should fix #66