Integration Test Showing 0% code coverage

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Integration Test Showing 0% code coverage

softwareforums2013
Hi Everyone,

I have added the property to get code coverage for integration test in pom.xml.
<sonar.dynamicAnalysis>reuseReports</sonar.dynamicAnalysis>
<sonar.jacoco.itReportPath>../../sonarReports/jacoco/jacoco.exec</sonar.jacoco.itReportPath>

I am using jacoco to get code coverage. Before jacoco wasnt generating the code coverage and the file size was always zero. So, my integration test code coverage showed 0 in sonar dashboard.

But now I have fixed issue and now jacoco is generating the code coverage and I see the file size increases as the test keeps going on. After the test has comepleted, I have mentioned sonar to reuse the same file with the property mentioned above.

I am using cobertura for unit test code coverage. And I see code coverage for unit test with no issue.

I did not have integration widget before. I only had unit test code coverage widget. Is there something I am missing which is not letting me see my code coverage in sonar dashboard for integration test.



Reply | Threaded
Open this post in threaded view
|

Re: Integration Test Showing 0% code coverage

David Racodon-2
Hi,

What does the log file say?

Thank you

Regards,


David RACODON | SonarSource
Senior Consultant

---------------------------------------------
  Sign up to our newsletter here!
---------------------------------------------


On Sat, Dec 14, 2013 at 2:15 PM, softwareforums2013 <[hidden email]> wrote:
Hi Everyone,

I have added the property to get code coverage for integration test in
pom.xml.
<sonar.dynamicAnalysis>reuseReports</sonar.dynamicAnalysis>
<sonar.jacoco.itReportPath>../../sonarReports/jacoco/jacoco.exec</sonar.jacoco.itReportPath>

I am using jacoco to get code coverage. Before jacoco wasnt generating the
code coverage and the file size was always zero. So, my integration test
code coverage showed 0 in sonar dashboard.

But now I have fixed issue and now jacoco is generating the code coverage
and I see the file size increases as the test keeps going on. After the test
has comepleted, I have mentioned sonar to reuse the same file with the
property mentioned above.

I am using cobertura for unit test code coverage. And I see code coverage
for unit test with no issue.

I did not have integration widget before. I only had unit test code coverage
widget. Is there something I am missing which is not letting me see my code
coverage in sonar dashboard for integration test.







--
View this message in context: http://sonarqube.15.x6.nabble.com/Integration-Test-Showing-0-code-coverage-tp5020169.html
Sent from the SonarQube Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Reply | Threaded
Open this post in threaded view
|

Re: Integration Test Showing 0% code coverage

softwareforums2013
Hi David,
 
I think I found the isse but I am not 100% sure. Still doing some analysis on it .
 
Issue: I am using cobertura for my unit test code coverage which means my code are being instrumented by cobertura. And now I am trying to get code coverage for acceptance test using jacoco. So, I think the reason is that you cant get code coverage using jacoco if you have instrumented your code using cobertura.
 
I compiled and executed my code on my local with out instrumenting my code using cobertura and using only jacoco, converted jacoco.exec file to .html /.csv. I see the code coverage.
I comiled and executed my code with cobertrua and jacoco on and converted jacoco.exec file to .html/.csv. I see 0% code coverage.
 
I dont think this is sonar related issue.
 
But  a quick question. Do you think the above issue I have mentioned seems correct?
 


On Mon, Dec 16, 2013 at 3:41 AM, David Racodon <[hidden email]> wrote:
Hi,

What does the log file say?

Thank you

Regards,


David RACODON | SonarSource
Senior Consultant

---------------------------------------------
  Sign up to our newsletter here!
---------------------------------------------


On Sat, Dec 14, 2013 at 2:15 PM, softwareforums2013 <[hidden email]> wrote:
Hi Everyone,

I have added the property to get code coverage for integration test in
pom.xml.
<sonar.dynamicAnalysis>reuseReports</sonar.dynamicAnalysis>
<sonar.jacoco.itReportPath>../../sonarReports/jacoco/jacoco.exec</sonar.jacoco.itReportPath>

I am using jacoco to get code coverage. Before jacoco wasnt generating the
code coverage and the file size was always zero. So, my integration test
code coverage showed 0 in sonar dashboard.

But now I have fixed issue and now jacoco is generating the code coverage
and I see the file size increases as the test keeps going on. After the test
has comepleted, I have mentioned sonar to reuse the same file with the
property mentioned above.

I am using cobertura for unit test code coverage. And I see code coverage
for unit test with no issue.

I did not have integration widget before. I only had unit test code coverage
widget. Is there something I am missing which is not letting me see my code
coverage in sonar dashboard for integration test.







--
View this message in context: http://sonarqube.15.x6.nabble.com/Integration-Test-Showing-0-code-coverage-tp5020169.html
Sent from the SonarQube Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email




Reply | Threaded
Open this post in threaded view
|

Re: Integration Test Showing 0% code coverage

David Racodon-2
Hi,

SonarQube just read the provided JaCoCo report. So, your issue doesn't seem to be SonarQube related.
As as side note, I recommend you to use JaCoCo for both unit tests and integration tests to get consistent results.

Regards,


David RACODON | SonarSource
Senior Consultant

---------------------------------------------
  Sign up to our newsletter here!
---------------------------------------------


On Mon, Dec 16, 2013 at 5:12 PM, aaron blood <[hidden email]> wrote:
Hi David,
 
I think I found the isse but I am not 100% sure. Still doing some analysis on it .
 
Issue: I am using cobertura for my unit test code coverage which means my code are being instrumented by cobertura. And now I am trying to get code coverage for acceptance test using jacoco. So, I think the reason is that you cant get code coverage using jacoco if you have instrumented your code using cobertura.
 
I compiled and executed my code on my local with out instrumenting my code using cobertura and using only jacoco, converted jacoco.exec file to .html /.csv. I see the code coverage.
I comiled and executed my code with cobertrua and jacoco on and converted jacoco.exec file to .html/.csv. I see 0% code coverage.
 
I dont think this is sonar related issue.
 
But  a quick question. Do you think the above issue I have mentioned seems correct?
 


On Mon, Dec 16, 2013 at 3:41 AM, David Racodon <[hidden email]> wrote:
Hi,

What does the log file say?

Thank you

Regards,


David RACODON | SonarSource
Senior Consultant

---------------------------------------------
  Sign up to our newsletter here!
---------------------------------------------


On Sat, Dec 14, 2013 at 2:15 PM, softwareforums2013 <[hidden email]> wrote:
Hi Everyone,

I have added the property to get code coverage for integration test in
pom.xml.
<sonar.dynamicAnalysis>reuseReports</sonar.dynamicAnalysis>
<sonar.jacoco.itReportPath>../../sonarReports/jacoco/jacoco.exec</sonar.jacoco.itReportPath>

I am using jacoco to get code coverage. Before jacoco wasnt generating the
code coverage and the file size was always zero. So, my integration test
code coverage showed 0 in sonar dashboard.

But now I have fixed issue and now jacoco is generating the code coverage
and I see the file size increases as the test keeps going on. After the test
has comepleted, I have mentioned sonar to reuse the same file with the
property mentioned above.

I am using cobertura for unit test code coverage. And I see code coverage
for unit test with no issue.

I did not have integration widget before. I only had unit test code coverage
widget. Is there something I am missing which is not letting me see my code
coverage in sonar dashboard for integration test.







--
View this message in context: http://sonarqube.15.x6.nabble.com/Integration-Test-Showing-0-code-coverage-tp5020169.html
Sent from the SonarQube Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email