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
Add XML generator for sonarqube generic coverage report #308
Conversation
Thank you for this PR, that looks fantastic. It is fine to leave the PR open while you work on it. The Travis test failures seem to only be about code style issues (unused variables). What I need from you before I can merge:
Please let me know if you run into any problems. |
Codecov Report
@@ Coverage Diff @@
## master #308 +/- ##
==========================================
- Coverage 94.89% 92.11% -2.79%
==========================================
Files 15 16 +1
Lines 1823 1890 +67
Branches 315 327 +12
==========================================
+ Hits 1730 1741 +11
- Misses 46 101 +55
- Partials 47 48 +1
Continue to review full report at Codecov.
|
2 similar comments
Codecov Report
@@ Coverage Diff @@
## master #308 +/- ##
==========================================
- Coverage 94.89% 92.11% -2.79%
==========================================
Files 15 16 +1
Lines 1823 1890 +67
Branches 315 327 +12
==========================================
+ Hits 1730 1741 +11
- Misses 46 101 +55
- Partials 47 48 +1
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #308 +/- ##
==========================================
- Coverage 94.89% 92.11% -2.79%
==========================================
Files 15 16 +1
Lines 1823 1890 +67
Branches 315 327 +12
==========================================
+ Hits 1730 1741 +11
- Misses 46 101 +55
- Partials 47 48 +1
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #308 +/- ##
==========================================
- Coverage 94.89% 94.71% -0.19%
==========================================
Files 15 16 +1
Lines 1823 1874 +51
Branches 315 324 +9
==========================================
+ Hits 1730 1775 +45
- Misses 46 49 +3
- Partials 47 50 +3
Continue to review full report at Codecov.
|
Sorry, I didn't notice it was reopened. I am quite a newbie in python so this might take time, and I use msys2 on windows, it seems some of the test cases would fail. |
No worries. I'm thankful for any work that you can do!
The tests assume a specific GCC version (GCC 5) and may fail under
different versions. This is not a problem, as long as Travis/Appveyor are
green. If extending the tests is too tricky then I can look into it myself.
TBH this is the first time in forever that a new test target is added, so
this would be nontrivial for me as well.
The part about tests that I definitely need from you is that you confirm
that the generated XML is accepted by Sonarqube, for example by using your
modified version of gcovr in your build pipeline. If that seems to work,
I'm confident it will be all right for others as well.
Again, thank you very much for working on this, and please reach out if I
can help.
…On Mon, 6 May 2019 at 14:12, akmll ***@***.***> wrote:
Sorry, I didn't notice it was reopened. I am quite a newbie in python so
this might take time, and I use msys2 on windows, it seems some of the test
cases would fail.
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#308 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AANTJD7H7XIQJNDPMNOGIXTPUAOCNANCNFSM4HK5VHBA>
.
|
The error is cause by in-consistent output of different gcc versions
Finally I have made the unit tests to success. The uncovered lines of code share across the generators, so I think it is OK. I have tested the generator with a real project under enterprise environment and it works like a charm, the coverage information is just the same as the html report generated. I read in the PR #307 that the memory usage is high with xml.minidom. I was thinking about generating the xml text directly since the format is rather simple. I am not very familiar with python, so I am not sure if that would help. Another thing needs to mention is that there is no stdout print option for this sonarqube generator, I could add it easily if there is such scenario. |
This looks great! I'll probably fiddle a bit with the details while merging, but all the necessary stuff is there now. Thank you for working on this :)
OK, I've merged this manually! I decided not to use the string-based output generation but rather ported to lxml. Your idea to pass the output file name via Thanks again for working on this! |
Add command line option '--sonarqube' with output report file name to generate sonarqube generic coverage report as described in https://docs.sonarqube.org/latest/analysis/generic-test/