how to have different types of unittest on sonar

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

how to have different types of unittest on sonar

softwareforums2013
I am newbie to this sonar. In our project we used to write our unit-test using testNG but now we have decided to use mockito. So, currently in sonar dashboard, our code coverage and unit test sucess shows only testNG but if I want the mockito unit-test to also be covered using sonar. How can I accomplish this?
Reply | Threaded
Open this post in threaded view
|

Re: how to have different types of unittest on sonar

Freddy Mallet
There is no easy way to do this. 

Kind regards,
Freddy

-----
SonarQube for Continuous Inspection


On Fri, Oct 11, 2013 at 8:47 PM, softwareforums2013 <[hidden email]> wrote:
I am newbie to this sonar. In our project we used to write our unit-test
using testNG but now we have decided to use mockito. So, currently in sonar
dashboard, our code coverage and unit test sucess shows only testNG but if I
want the mockito unit-test to also be covered using sonar. How can I
accomplish this?



--
View this message in context: http://sonarqube.15.x6.nabble.com/how-to-have-different-types-of-unittest-on-sonar-tp5017897.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: how to have different types of unittest on sonar

David Racodon-2
Hi,

As a workaround, if you can generate a JaCoCo report while running mockito unit tests, you can import it as coverage by integration tests. You can then get the overall code coverage (by both your kinds of unit tests). See http://docs.codehaus.org/display/SONAR/Code+Coverage+by+Integration+Tests+for+Java+Project.

Regards,


David RACODON | SonarSource
Senior Consultant

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


On Sun, Oct 13, 2013 at 2:56 PM, Freddy Mallet <[hidden email]> wrote:
There is no easy way to do this. 

Kind regards,
Freddy

-----
SonarQube for Continuous Inspection


On Fri, Oct 11, 2013 at 8:47 PM, softwareforums2013 <[hidden email]> wrote:
I am newbie to this sonar. In our project we used to write our unit-test
using testNG but now we have decided to use mockito. So, currently in sonar
dashboard, our code coverage and unit test sucess shows only testNG but if I
want the mockito unit-test to also be covered using sonar. How can I
accomplish this?



--
View this message in context: http://sonarqube.15.x6.nabble.com/how-to-have-different-types-of-unittest-on-sonar-tp5017897.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: how to have different types of unittest on sonar

softwareforums2013
Thank you for the information.


On Mon, Oct 14, 2013 at 12:24 AM, David Racodon <[hidden email]> wrote:
Hi,

As a workaround, if you can generate a JaCoCo report while running mockito unit tests, you can import it as coverage by integration tests. You can then get the overall code coverage (by both your kinds of unit tests). See http://docs.codehaus.org/display/SONAR/Code+Coverage+by+Integration+Tests+for+Java+Project.

Regards,


David RACODON | SonarSource
Senior Consultant

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


On Sun, Oct 13, 2013 at 2:56 PM, Freddy Mallet <[hidden email]> wrote:
There is no easy way to do this. 

Kind regards,
Freddy

-----
SonarQube for Continuous Inspection


On Fri, Oct 11, 2013 at 8:47 PM, softwareforums2013 <[hidden email]> wrote:
I am newbie to this sonar. In our project we used to write our unit-test
using testNG but now we have decided to use mockito. So, currently in sonar
dashboard, our code coverage and unit test sucess shows only testNG but if I
want the mockito unit-test to also be covered using sonar. How can I
accomplish this?



--
View this message in context: http://sonarqube.15.x6.nabble.com/how-to-have-different-types-of-unittest-on-sonar-tp5017897.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: how to have different types of unittest on sonar

softwareforums2013
I was looking into that resources and I do have a question. It says on there, "Since version 3.3, the overall code coverage (combination of code coverage by unit tests and integration tests) is automatically computed. This feature is enabled when both code coverage reports (UT + IT) are generated with JaCoCo. If coverage by unit tests is not computed with JaCoCo, overall coverage = integration test coverage."
 
But we are using cobertura for code coverage right now for testNg and if I use JaCoCo for mockito unit test. According to the above statement it says overall code coverage is enabled only when both code coverage reports are generated with JaCoCo.
 
Plus we are using the version 3.2, so does that means the overall code coverage is not automatically computed.


On Tue, Oct 15, 2013 at 9:25 AM, aaron blood <[hidden email]> wrote:
Thank you for the information.


On Mon, Oct 14, 2013 at 12:24 AM, David Racodon <[hidden email]> wrote:
Hi,

As a workaround, if you can generate a JaCoCo report while running mockito unit tests, you can import it as coverage by integration tests. You can then get the overall code coverage (by both your kinds of unit tests). See http://docs.codehaus.org/display/SONAR/Code+Coverage+by+Integration+Tests+for+Java+Project.

Regards,


David RACODON | SonarSource
Senior Consultant

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


On Sun, Oct 13, 2013 at 2:56 PM, Freddy Mallet <[hidden email]> wrote:
There is no easy way to do this. 

Kind regards,
Freddy

-----
SonarQube for Continuous Inspection


On Fri, Oct 11, 2013 at 8:47 PM, softwareforums2013 <[hidden email]> wrote:
I am newbie to this sonar. In our project we used to write our unit-test
using testNG but now we have decided to use mockito. So, currently in sonar
dashboard, our code coverage and unit test sucess shows only testNG but if I
want the mockito unit-test to also be covered using sonar. How can I
accomplish this?



--
View this message in context: http://sonarqube.15.x6.nabble.com/how-to-have-different-types-of-unittest-on-sonar-tp5017897.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: how to have different types of unittest on sonar

David Racodon-2
Hi,

Indeed, the overall code coverage won't be computed.
Is moving from Cobertura to JaCoCo for testNg a possibility on your side?

Regards,


David RACODON | SonarSource
Senior Consultant

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


On Tue, Oct 15, 2013 at 6:43 PM, aaron blood <[hidden email]> wrote:
I was looking into that resources and I do have a question. It says on there, "Since version 3.3, the overall code coverage (combination of code coverage by unit tests and integration tests) is automatically computed. This feature is enabled when both code coverage reports (UT + IT) are generated with JaCoCo. If coverage by unit tests is not computed with JaCoCo, overall coverage = integration test coverage."
 
But we are using cobertura for code coverage right now for testNg and if I use JaCoCo for mockito unit test. According to the above statement it says overall code coverage is enabled only when both code coverage reports are generated with JaCoCo.
 
Plus we are using the version 3.2, so does that means the overall code coverage is not automatically computed.


On Tue, Oct 15, 2013 at 9:25 AM, aaron blood <[hidden email]> wrote:
Thank you for the information.


On Mon, Oct 14, 2013 at 12:24 AM, David Racodon <[hidden email]> wrote:
Hi,

As a workaround, if you can generate a JaCoCo report while running mockito unit tests, you can import it as coverage by integration tests. You can then get the overall code coverage (by both your kinds of unit tests). See http://docs.codehaus.org/display/SONAR/Code+Coverage+by+Integration+Tests+for+Java+Project.

Regards,


David RACODON | SonarSource
Senior Consultant

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


On Sun, Oct 13, 2013 at 2:56 PM, Freddy Mallet <[hidden email]> wrote:
There is no easy way to do this. 

Kind regards,
Freddy

-----
SonarQube for Continuous Inspection


On Fri, Oct 11, 2013 at 8:47 PM, softwareforums2013 <[hidden email]> wrote:
I am newbie to this sonar. In our project we used to write our unit-test
using testNG but now we have decided to use mockito. So, currently in sonar
dashboard, our code coverage and unit test sucess shows only testNG but if I
want the mockito unit-test to also be covered using sonar. How can I
accomplish this?



--
View this message in context: http://sonarqube.15.x6.nabble.com/how-to-have-different-types-of-unittest-on-sonar-tp5017897.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: how to have different types of unittest on sonar

softwareforums2013
if there is no work around, I think we will have to move from cobertura to Jacoco


On Tue, Oct 15, 2013 at 12:12 PM, David Racodon <[hidden email]> wrote:
Hi,

Indeed, the overall code coverage won't be computed.
Is moving from Cobertura to JaCoCo for testNg a possibility on your side?

Regards,


David RACODON | SonarSource
Senior Consultant

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


On Tue, Oct 15, 2013 at 6:43 PM, aaron blood <[hidden email]> wrote:
I was looking into that resources and I do have a question. It says on there, "Since version 3.3, the overall code coverage (combination of code coverage by unit tests and integration tests) is automatically computed. This feature is enabled when both code coverage reports (UT + IT) are generated with JaCoCo. If coverage by unit tests is not computed with JaCoCo, overall coverage = integration test coverage."
 
But we are using cobertura for code coverage right now for testNg and if I use JaCoCo for mockito unit test. According to the above statement it says overall code coverage is enabled only when both code coverage reports are generated with JaCoCo.
 
Plus we are using the version 3.2, so does that means the overall code coverage is not automatically computed.


On Tue, Oct 15, 2013 at 9:25 AM, aaron blood <[hidden email]> wrote:
Thank you for the information.


On Mon, Oct 14, 2013 at 12:24 AM, David Racodon <[hidden email]> wrote:
Hi,

As a workaround, if you can generate a JaCoCo report while running mockito unit tests, you can import it as coverage by integration tests. You can then get the overall code coverage (by both your kinds of unit tests). See http://docs.codehaus.org/display/SONAR/Code+Coverage+by+Integration+Tests+for+Java+Project.

Regards,


David RACODON | SonarSource
Senior Consultant

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


On Sun, Oct 13, 2013 at 2:56 PM, Freddy Mallet <[hidden email]> wrote:
There is no easy way to do this. 

Kind regards,
Freddy

-----
SonarQube for Continuous Inspection


On Fri, Oct 11, 2013 at 8:47 PM, softwareforums2013 <[hidden email]> wrote:
I am newbie to this sonar. In our project we used to write our unit-test
using testNG but now we have decided to use mockito. So, currently in sonar
dashboard, our code coverage and unit test sucess shows only testNG but if I
want the mockito unit-test to also be covered using sonar. How can I
accomplish this?



--
View this message in context: http://sonarqube.15.x6.nabble.com/how-to-have-different-types-of-unittest-on-sonar-tp5017897.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: how to have different types of unittest on sonar

softwareforums2013
Is this possible if I approach the step below?
 
If I use cobertura for both testNG and Mockito, will sonar compute overall code coverage? I know on the document it said, "This feature is enabled when both code coverage reports (UT + IT) are generated with JaCoCo". And if it does not will this feature be available in new patch release.


On Tue, Oct 15, 2013 at 12:58 PM, aaron blood <[hidden email]> wrote:
if there is no work around, I think we will have to move from cobertura to Jacoco


On Tue, Oct 15, 2013 at 12:12 PM, David Racodon <[hidden email]> wrote:
Hi,

Indeed, the overall code coverage won't be computed.
Is moving from Cobertura to JaCoCo for testNg a possibility on your side?

Regards,


David RACODON | SonarSource
Senior Consultant

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


On Tue, Oct 15, 2013 at 6:43 PM, aaron blood <[hidden email]> wrote:
I was looking into that resources and I do have a question. It says on there, "Since version 3.3, the overall code coverage (combination of code coverage by unit tests and integration tests) is automatically computed. This feature is enabled when both code coverage reports (UT + IT) are generated with JaCoCo. If coverage by unit tests is not computed with JaCoCo, overall coverage = integration test coverage."
 
But we are using cobertura for code coverage right now for testNg and if I use JaCoCo for mockito unit test. According to the above statement it says overall code coverage is enabled only when both code coverage reports are generated with JaCoCo.
 
Plus we are using the version 3.2, so does that means the overall code coverage is not automatically computed.


On Tue, Oct 15, 2013 at 9:25 AM, aaron blood <[hidden email]> wrote:
Thank you for the information.


On Mon, Oct 14, 2013 at 12:24 AM, David Racodon <[hidden email]> wrote:
Hi,

As a workaround, if you can generate a JaCoCo report while running mockito unit tests, you can import it as coverage by integration tests. You can then get the overall code coverage (by both your kinds of unit tests). See http://docs.codehaus.org/display/SONAR/Code+Coverage+by+Integration+Tests+for+Java+Project.

Regards,


David RACODON | SonarSource
Senior Consultant

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


On Sun, Oct 13, 2013 at 2:56 PM, Freddy Mallet <[hidden email]> wrote:
There is no easy way to do this. 

Kind regards,
Freddy

-----
SonarQube for Continuous Inspection


On Fri, Oct 11, 2013 at 8:47 PM, softwareforums2013 <[hidden email]> wrote:
I am newbie to this sonar. In our project we used to write our unit-test
using testNG but now we have decided to use mockito. So, currently in sonar
dashboard, our code coverage and unit test sucess shows only testNG but if I
want the mockito unit-test to also be covered using sonar. How can I
accomplish this?



--
View this message in context: http://sonarqube.15.x6.nabble.com/how-to-have-different-types-of-unittest-on-sonar-tp5017897.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: how to have different types of unittest on sonar

David Racodon-2
Hi,

This is currently planned for SonarQube 4.1.

Regards,


David RACODON | SonarSource
Senior Consultant

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


On Wed, Oct 16, 2013 at 5:55 PM, aaron blood <[hidden email]> wrote:
Is this possible if I approach the step below?
 
If I use cobertura for both testNG and Mockito, will sonar compute overall code coverage? I know on the document it said, "This feature is enabled when both code coverage reports (UT + IT) are generated with JaCoCo". And if it does not will this feature be available in new patch release.


On Tue, Oct 15, 2013 at 12:58 PM, aaron blood <[hidden email]> wrote:
if there is no work around, I think we will have to move from cobertura to Jacoco


On Tue, Oct 15, 2013 at 12:12 PM, David Racodon <[hidden email]> wrote:
Hi,

Indeed, the overall code coverage won't be computed.
Is moving from Cobertura to JaCoCo for testNg a possibility on your side?

Regards,


David RACODON | SonarSource
Senior Consultant

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


On Tue, Oct 15, 2013 at 6:43 PM, aaron blood <[hidden email]> wrote:
I was looking into that resources and I do have a question. It says on there, "Since version 3.3, the overall code coverage (combination of code coverage by unit tests and integration tests) is automatically computed. This feature is enabled when both code coverage reports (UT + IT) are generated with JaCoCo. If coverage by unit tests is not computed with JaCoCo, overall coverage = integration test coverage."
 
But we are using cobertura for code coverage right now for testNg and if I use JaCoCo for mockito unit test. According to the above statement it says overall code coverage is enabled only when both code coverage reports are generated with JaCoCo.
 
Plus we are using the version 3.2, so does that means the overall code coverage is not automatically computed.


On Tue, Oct 15, 2013 at 9:25 AM, aaron blood <[hidden email]> wrote:
Thank you for the information.


On Mon, Oct 14, 2013 at 12:24 AM, David Racodon <[hidden email]> wrote:
Hi,

As a workaround, if you can generate a JaCoCo report while running mockito unit tests, you can import it as coverage by integration tests. You can then get the overall code coverage (by both your kinds of unit tests). See http://docs.codehaus.org/display/SONAR/Code+Coverage+by+Integration+Tests+for+Java+Project.

Regards,


David RACODON | SonarSource
Senior Consultant

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


On Sun, Oct 13, 2013 at 2:56 PM, Freddy Mallet <[hidden email]> wrote:
There is no easy way to do this. 

Kind regards,
Freddy

-----
SonarQube for Continuous Inspection


On Fri, Oct 11, 2013 at 8:47 PM, softwareforums2013 <[hidden email]> wrote:
I am newbie to this sonar. In our project we used to write our unit-test
using testNG but now we have decided to use mockito. So, currently in sonar
dashboard, our code coverage and unit test sucess shows only testNG but if I
want the mockito unit-test to also be covered using sonar. How can I
accomplish this?



--
View this message in context: http://sonarqube.15.x6.nabble.com/how-to-have-different-types-of-unittest-on-sonar-tp5017897.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: how to have different types of unittest on sonar

softwareforums2013
thank you


On Wed, Oct 16, 2013 at 10:32 AM, David Racodon <[hidden email]> wrote:
Hi,

This is currently planned for SonarQube 4.1.

Regards,


David RACODON | SonarSource
Senior Consultant

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


On Wed, Oct 16, 2013 at 5:55 PM, aaron blood <[hidden email]> wrote:
Is this possible if I approach the step below?
 
If I use cobertura for both testNG and Mockito, will sonar compute overall code coverage? I know on the document it said, "This feature is enabled when both code coverage reports (UT + IT) are generated with JaCoCo". And if it does not will this feature be available in new patch release.


On Tue, Oct 15, 2013 at 12:58 PM, aaron blood <[hidden email]> wrote:
if there is no work around, I think we will have to move from cobertura to Jacoco


On Tue, Oct 15, 2013 at 12:12 PM, David Racodon <[hidden email]> wrote:
Hi,

Indeed, the overall code coverage won't be computed.
Is moving from Cobertura to JaCoCo for testNg a possibility on your side?

Regards,


David RACODON | SonarSource
Senior Consultant

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


On Tue, Oct 15, 2013 at 6:43 PM, aaron blood <[hidden email]> wrote:
I was looking into that resources and I do have a question. It says on there, "Since version 3.3, the overall code coverage (combination of code coverage by unit tests and integration tests) is automatically computed. This feature is enabled when both code coverage reports (UT + IT) are generated with JaCoCo. If coverage by unit tests is not computed with JaCoCo, overall coverage = integration test coverage."
 
But we are using cobertura for code coverage right now for testNg and if I use JaCoCo for mockito unit test. According to the above statement it says overall code coverage is enabled only when both code coverage reports are generated with JaCoCo.
 
Plus we are using the version 3.2, so does that means the overall code coverage is not automatically computed.


On Tue, Oct 15, 2013 at 9:25 AM, aaron blood <[hidden email]> wrote:
Thank you for the information.


On Mon, Oct 14, 2013 at 12:24 AM, David Racodon <[hidden email]> wrote:
Hi,

As a workaround, if you can generate a JaCoCo report while running mockito unit tests, you can import it as coverage by integration tests. You can then get the overall code coverage (by both your kinds of unit tests). See http://docs.codehaus.org/display/SONAR/Code+Coverage+by+Integration+Tests+for+Java+Project.

Regards,


David RACODON | SonarSource
Senior Consultant

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


On Sun, Oct 13, 2013 at 2:56 PM, Freddy Mallet <[hidden email]> wrote:
There is no easy way to do this. 

Kind regards,
Freddy

-----
SonarQube for Continuous Inspection


On Fri, Oct 11, 2013 at 8:47 PM, softwareforums2013 <[hidden email]> wrote:
I am newbie to this sonar. In our project we used to write our unit-test
using testNG but now we have decided to use mockito. So, currently in sonar
dashboard, our code coverage and unit test sucess shows only testNG but if I
want the mockito unit-test to also be covered using sonar. How can I
accomplish this?



--
View this message in context: http://sonarqube.15.x6.nabble.com/how-to-have-different-types-of-unittest-on-sonar-tp5017897.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: how to have different types of unittest on sonar

softwareforums2013
Hi David,
 
From what I understood in our project, we have 2 step process.
 
1. we run our build and we generate .ser file for testNg during our first build and convert this to .xml 
2. we pass this path for .xml file during sonar build so instead of having sonar execute our testNg test we tell sonar to reuse our testreport that we generated during our first build.
 
Now, we are using Mockito framework for unit test.
And we are planning to have sonar execute this mockito test and output the .ser file which gets converted to .xml during sonar build.
 
My question here is, During our first build after we generate .ser file for testNG tests can we pass this file during sonar build and have sonar run the mockito test and output .ser file for mockito test on top of the .ser file we have mentioned. So, this way .ser file will contain the report for both testNG and mockito.
 
Or will sonar override the .ser fileI(which contain testNg report) we have passed and create new .ser file which will only contain mockito report.
 
 
 
 


On Wed, Oct 16, 2013 at 11:59 AM, aaron blood <[hidden email]> wrote:
thank you


On Wed, Oct 16, 2013 at 10:32 AM, David Racodon <[hidden email]> wrote:
Hi,

This is currently planned for SonarQube 4.1.

Regards,


David RACODON | SonarSource
Senior Consultant

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


On Wed, Oct 16, 2013 at 5:55 PM, aaron blood <[hidden email]> wrote:
Is this possible if I approach the step below?
 
If I use cobertura for both testNG and Mockito, will sonar compute overall code coverage? I know on the document it said, "This feature is enabled when both code coverage reports (UT + IT) are generated with JaCoCo". And if it does not will this feature be available in new patch release.


On Tue, Oct 15, 2013 at 12:58 PM, aaron blood <[hidden email]> wrote:
if there is no work around, I think we will have to move from cobertura to Jacoco


On Tue, Oct 15, 2013 at 12:12 PM, David Racodon <[hidden email]> wrote:
Hi,

Indeed, the overall code coverage won't be computed.
Is moving from Cobertura to JaCoCo for testNg a possibility on your side?

Regards,


David RACODON | SonarSource
Senior Consultant

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


On Tue, Oct 15, 2013 at 6:43 PM, aaron blood <[hidden email]> wrote:
I was looking into that resources and I do have a question. It says on there, "Since version 3.3, the overall code coverage (combination of code coverage by unit tests and integration tests) is automatically computed. This feature is enabled when both code coverage reports (UT + IT) are generated with JaCoCo. If coverage by unit tests is not computed with JaCoCo, overall coverage = integration test coverage."
 
But we are using cobertura for code coverage right now for testNg and if I use JaCoCo for mockito unit test. According to the above statement it says overall code coverage is enabled only when both code coverage reports are generated with JaCoCo.
 
Plus we are using the version 3.2, so does that means the overall code coverage is not automatically computed.


On Tue, Oct 15, 2013 at 9:25 AM, aaron blood <[hidden email]> wrote:
Thank you for the information.


On Mon, Oct 14, 2013 at 12:24 AM, David Racodon <[hidden email]> wrote:
Hi,

As a workaround, if you can generate a JaCoCo report while running mockito unit tests, you can import it as coverage by integration tests. You can then get the overall code coverage (by both your kinds of unit tests). See http://docs.codehaus.org/display/SONAR/Code+Coverage+by+Integration+Tests+for+Java+Project.

Regards,


David RACODON | SonarSource
Senior Consultant

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


On Sun, Oct 13, 2013 at 2:56 PM, Freddy Mallet <[hidden email]> wrote:
There is no easy way to do this. 

Kind regards,
Freddy

-----
SonarQube for Continuous Inspection


On Fri, Oct 11, 2013 at 8:47 PM, softwareforums2013 <[hidden email]> wrote:
I am newbie to this sonar. In our project we used to write our unit-test
using testNG but now we have decided to use mockito. So, currently in sonar
dashboard, our code coverage and unit test sucess shows only testNG but if I
want the mockito unit-test to also be covered using sonar. How can I
accomplish this?



--
View this message in context: http://sonarqube.15.x6.nabble.com/how-to-have-different-types-of-unittest-on-sonar-tp5017897.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: how to have different types of unittest on sonar

David Racodon-2
Hi,
 
My question here is, During our first build after we generate .ser file for testNG tests can we pass this file during sonar build and have sonar run the mockito test and output .ser file for mockito test on top of the .ser file we have mentioned. So, this way .ser file will contain the report for both testNG and mockito.

No, it's not possible. It is either reuseReports mode or dynamic mode. You can't have half reuseReports and the other half dynamic.
I don't know anything about it but you may try to see if you can merge both reports before passing it to SonarQube.
Regards,


David RACODON | SonarSource
Senior Consultant

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


On Thu, Oct 17, 2013 at 9:57 PM, aaron blood <[hidden email]> wrote:
Hi David,
 
From what I understood in our project, we have 2 step process.
 
1. we run our build and we generate .ser file for testNg during our first build and convert this to .xml 
2. we pass this path for .xml file during sonar build so instead of having sonar execute our testNg test we tell sonar to reuse our testreport that we generated during our first build.
 
Now, we are using Mockito framework for unit test.
And we are planning to have sonar execute this mockito test and output the .ser file which gets converted to .xml during sonar build.
 
My question here is, During our first build after we generate .ser file for testNG tests can we pass this file during sonar build and have sonar run the mockito test and output .ser file for mockito test on top of the .ser file we have mentioned. So, this way .ser file will contain the report for both testNG and mockito.
 
Or will sonar override the .ser fileI(which contain testNg report) we have passed and create new .ser file which will only contain mockito report.
 
 
 
 


On Wed, Oct 16, 2013 at 11:59 AM, aaron blood <[hidden email]> wrote:
thank you


On Wed, Oct 16, 2013 at 10:32 AM, David Racodon <[hidden email]> wrote:
Hi,

This is currently planned for SonarQube 4.1.

Regards,


David RACODON | SonarSource
Senior Consultant

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


On Wed, Oct 16, 2013 at 5:55 PM, aaron blood <[hidden email]> wrote:
Is this possible if I approach the step below?
 
If I use cobertura for both testNG and Mockito, will sonar compute overall code coverage? I know on the document it said, "This feature is enabled when both code coverage reports (UT + IT) are generated with JaCoCo". And if it does not will this feature be available in new patch release.


On Tue, Oct 15, 2013 at 12:58 PM, aaron blood <[hidden email]> wrote:
if there is no work around, I think we will have to move from cobertura to Jacoco


On Tue, Oct 15, 2013 at 12:12 PM, David Racodon <[hidden email]> wrote:
Hi,

Indeed, the overall code coverage won't be computed.
Is moving from Cobertura to JaCoCo for testNg a possibility on your side?

Regards,


David RACODON | SonarSource
Senior Consultant

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


On Tue, Oct 15, 2013 at 6:43 PM, aaron blood <[hidden email]> wrote:
I was looking into that resources and I do have a question. It says on there, "Since version 3.3, the overall code coverage (combination of code coverage by unit tests and integration tests) is automatically computed. This feature is enabled when both code coverage reports (UT + IT) are generated with JaCoCo. If coverage by unit tests is not computed with JaCoCo, overall coverage = integration test coverage."
 
But we are using cobertura for code coverage right now for testNg and if I use JaCoCo for mockito unit test. According to the above statement it says overall code coverage is enabled only when both code coverage reports are generated with JaCoCo.
 
Plus we are using the version 3.2, so does that means the overall code coverage is not automatically computed.


On Tue, Oct 15, 2013 at 9:25 AM, aaron blood <[hidden email]> wrote:
Thank you for the information.


On Mon, Oct 14, 2013 at 12:24 AM, David Racodon <[hidden email]> wrote:
Hi,

As a workaround, if you can generate a JaCoCo report while running mockito unit tests, you can import it as coverage by integration tests. You can then get the overall code coverage (by both your kinds of unit tests). See http://docs.codehaus.org/display/SONAR/Code+Coverage+by+Integration+Tests+for+Java+Project.

Regards,


David RACODON | SonarSource
Senior Consultant

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


On Sun, Oct 13, 2013 at 2:56 PM, Freddy Mallet <[hidden email]> wrote:
There is no easy way to do this. 

Kind regards,
Freddy

-----
SonarQube for Continuous Inspection


On Fri, Oct 11, 2013 at 8:47 PM, softwareforums2013 <[hidden email]> wrote:
I am newbie to this sonar. In our project we used to write our unit-test
using testNG but now we have decided to use mockito. So, currently in sonar
dashboard, our code coverage and unit test sucess shows only testNG but if I
want the mockito unit-test to also be covered using sonar. How can I
accomplish this?



--
View this message in context: http://sonarqube.15.x6.nabble.com/how-to-have-different-types-of-unittest-on-sonar-tp5017897.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