Quantcast

Sonar Jacoco Excludes

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Sonar Jacoco Excludes

LogbackUser
Hello,
I want to exclude few source code packages from being included in the jacoco code coverage report. As a test I specified a classname in the "sonar.jacoco.excludes" property but it did not help. The class was included in the code coverage report.
On googling more, I found two links - one which said that this issue is fixed while another issue on the same topic is unresolved. I would like to know if this feature works and if it does, how?

Thank you,
Amit.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Sonar Jacoco Excludes

Freddy Mallet
Hi Amit,

I did a test on my side and everything works as expected so could you provide a sample project to explain what your issue is ?

Moreover do you confirm that you're using a Sonar 3.X version ?

Kind regards,
Freddy
-----
Sonar for Continuous Inspection



On Fri, Oct 26, 2012 at 6:40 AM, amit shah <[hidden email]> wrote:
Hello,
I want to exclude few source code packages from being included in the jacoco code coverage report. As a test I specified a classname in the "sonar.jacoco.excludes" property but it did not help. The class was included in the code coverage report.
On googling more, I found two links - one which said that this issue is fixed while another issue on the same topic is unresolved. I would like to know if this feature works and if it does, how?

Thank you,
Amit.

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Sonar Jacoco Excludes

LogbackUser
Thanks for the reply Freddy. 

I didn't understand what you meant by sample project. Basically the issue is if I specify a class name in "sonar.jacoco.excludes" property it does not get excluded from the code coverage report generated by jacoco. I can still see the line coverage for that class as 0%. I give the class name in this format - com.companyname.ui.MyBackingBean. 
I am interested in using this property to exclude classes under one or more packages.

Also about the sonar version. No we are not using 3.X version of sonar. We use 2.11. Do you mean to say that this property works only in 3.X versions of sonar? 

Thanks,
Amit.

On Fri, Oct 26, 2012 at 7:18 PM, Freddy Mallet <[hidden email]> wrote:
Hi Amit,

I did a test on my side and everything works as expected so could you provide a sample project to explain what your issue is ?

Moreover do you confirm that you're using a Sonar 3.X version ?

Kind regards,
Freddy
-----
Sonar for Continuous Inspection



On Fri, Oct 26, 2012 at 6:40 AM, amit shah <[hidden email]> wrote:
Hello,
I want to exclude few source code packages from being included in the jacoco code coverage report. As a test I specified a classname in the "sonar.jacoco.excludes" property but it did not help. The class was included in the code coverage report.
On googling more, I found two links - one which said that this issue is fixed while another issue on the same topic is unresolved. I would like to know if this feature works and if it does, how?

Thank you,
Amit.


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Sonar Jacoco Excludes

LogbackUser
Any inputs?


On Mon, Oct 29, 2012 at 11:23 AM, amit shah <[hidden email]> wrote:
Thanks for the reply Freddy. 

I didn't understand what you meant by sample project. Basically the issue is if I specify a class name in "sonar.jacoco.excludes" property it does not get excluded from the code coverage report generated by jacoco. I can still see the line coverage for that class as 0%. I give the class name in this format - com.companyname.ui.MyBackingBean. 
I am interested in using this property to exclude classes under one or more packages.

Also about the sonar version. No we are not using 3.X version of sonar. We use 2.11. Do you mean to say that this property works only in 3.X versions of sonar? 

Thanks,
Amit.

On Fri, Oct 26, 2012 at 7:18 PM, Freddy Mallet <[hidden email]> wrote:
Hi Amit,

I did a test on my side and everything works as expected so could you provide a sample project to explain what your issue is ?

Moreover do you confirm that you're using a Sonar 3.X version ?

Kind regards,
Freddy
-----
Sonar for Continuous Inspection



On Fri, Oct 26, 2012 at 6:40 AM, amit shah <[hidden email]> wrote:
Hello,
I want to exclude few source code packages from being included in the jacoco code coverage report. As a test I specified a classname in the "sonar.jacoco.excludes" property but it did not help. The class was included in the code coverage report.
On googling more, I found two links - one which said that this issue is fixed while another issue on the same topic is unresolved. I would like to know if this feature works and if it does, how?

Thank you,
Amit.



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Sonar Jacoco Excludes

Freddy Mallet
Hi Amit, 

You're facing limitation https://jira.codehaus.org/browse/SONAR-3295 which has been fixed with Sonar 3.0.

So indeed you must upgrade to Sonar 3.X.

Kind regards

-----
Sonar for Continuous Inspection



On Fri, Nov 2, 2012 at 5:51 PM, amit shah <[hidden email]> wrote:
Any inputs?


On Mon, Oct 29, 2012 at 11:23 AM, amit shah <[hidden email]> wrote:
Thanks for the reply Freddy. 

I didn't understand what you meant by sample project. Basically the issue is if I specify a class name in "sonar.jacoco.excludes" property it does not get excluded from the code coverage report generated by jacoco. I can still see the line coverage for that class as 0%. I give the class name in this format - com.companyname.ui.MyBackingBean. 
I am interested in using this property to exclude classes under one or more packages.

Also about the sonar version. No we are not using 3.X version of sonar. We use 2.11. Do you mean to say that this property works only in 3.X versions of sonar? 

Thanks,
Amit.

On Fri, Oct 26, 2012 at 7:18 PM, Freddy Mallet <[hidden email]> wrote:
Hi Amit,

I did a test on my side and everything works as expected so could you provide a sample project to explain what your issue is ?

Moreover do you confirm that you're using a Sonar 3.X version ?

Kind regards,
Freddy
-----
Sonar for Continuous Inspection



On Fri, Oct 26, 2012 at 6:40 AM, amit shah <[hidden email]> wrote:
Hello,
I want to exclude few source code packages from being included in the jacoco code coverage report. As a test I specified a classname in the "sonar.jacoco.excludes" property but it did not help. The class was included in the code coverage report.
On googling more, I found two links - one which said that this issue is fixed while another issue on the same topic is unresolved. I would like to know if this feature works and if it does, how?

Thank you,
Amit.




Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Sonar Jacoco Excludes

Michel Pawlak
Hi Freddy,

First of all happy new year to Sonar's team.

I'm facing the exact same issue : when excluding packages from jacoco coverage computation through Sonar's configuration panel, the coverage percentage for the selected packages drops to 0% which in turn lowers global coverage (which is not what I'm trying to achieve, I rather want to ignore some packages during analysis and report which should then increase global coverage).

We are using Sonar 3.2 and the pattern I'm using is the following : *.exception.*:*.dto.*

Thanks in advance for your help.

Michel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Sonar Jacoco Excludes

Freddy Mallet
Hi Michel,

When using Sonar 3.3.2 (but Sonar 3.2 should behave exactly the same way) with for instance sonar.jacoco.excludes=*impl*, I get the expected result (cf screenshot)

Do you also use this parameter sonar.jacoco.excludes ?

Kind regards
Freddy

Inline image 1

-----
Sonar for Continuous Inspection


On Fri, Jan 4, 2013 at 3:11 PM, michel <[hidden email]> wrote:
Hi Freddy,

First of all happy new year to Sonar's team.

I'm facing the exact same issue : when excluding packages from jacoco
coverage computation through Sonar's configuration panel, the coverage
percentage for the selected packages drops to 0% which in turn lowers global
coverage (which is not what I'm trying to achieve, I rather want to ignore
some packages during analysis and report which should then increase global
coverage).

We are using Sonar 3.2 and the pattern I'm using is the following :
*.exception.*:*.dto.*

Thanks in advance for your help.

Michel



--
View this message in context: http://sonar.15.n6.nabble.com/Sonar-Jacoco-Excludes-tp5004698p5007031.html
Sent from the Sonar user 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
|  
Report Content as Inappropriate

Re: Sonar Jacoco Excludes

Michel Pawlak
Hi again Freddy,

Sorry for the late reply. But I couldn't focus on this issue until now.

When I use the pattern *.exceptions.*:*.dto.* the coverage appears as 0.0% and it is dispplayed in red in the trimap.

When I use the pattern *exceptions*:*dto* there is no coverage information for the package and it is displayed in grey.

Maybe there is a problem with dots in the exclusion pattern.

Cheers,

Michel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Sonar Jacoco Excludes

Michel Pawlak
By the way, yes I use the parameter sonar.jacoco.excludes .

Kind regards,

Michel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Sonar Jacoco Excludes

Evgeny Mandrikov
In reply to this post by Michel Pawlak
Hi Michel,

Could you please try to use pattern "*/exceptions/*:*/dto/*" ? In attachment you'll find what Freddy calls "example project" - this example demonstrates that this pattern works.


On Wed, Jan 30, 2013 at 3:20 PM, Michel Pawlak <[hidden email]> wrote:
Hi again Freddy,

Sorry for the late reply. But I couldn't focus on this issue until now.

When I use the pattern *.exceptions.*:*.dto.* the coverage appears as 0.0%
and it is dispplayed in red in the trimap.

When I use the pattern *exceptions*:*dto* there is no coverage information
for the package and it is displayed in grey.

Maybe there is a problem with dots in the exclusion pattern.

Cheers,

Michel



--
View this message in context: http://sonar.15.n6.nabble.com/Sonar-Jacoco-Excludes-tp5004698p5008212.html
Sent from the Sonar user mailing list archive at Nabble.com.

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

    http://xircles.codehaus.org/manage_email





--
Best regards,
Evgeny Mandrikov aka Godin <http://godin.net.ru>
http://twitter.com/_godin_


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

    http://xircles.codehaus.org/manage_email

jacoco-excludes.zip (7K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Sonar Jacoco Excludes

softwareforums2013
In reply to this post by Michel Pawlak
hi sonar,

Instead of mentioning exclude classes in pom.xml file, can I mention it in sonar, under setting/jacoco. Does this exclude from both IT and UT coverage? I would just like it to exclude from UT coverage and not IT coverage.
Loading...