Re: sonar.coverage.exclusions not working when added from the gradle plugin

3,572 views
Skip to first unread message

Julien HENRY

unread,
Jul 10, 2017, 3:49:34 AM7/10/17
to david marin, SonarLint
Hi David,

The settings seem to be correctly taken into account. Can you provide an example of a file path for which coverage is not correctly excluded?

Since we are using regexp under the hood, I wonder if the dollar symbol you are using in some patterns could be the issue...

++

Julien Henry | SonarSource

Developer

http://sonarsource.com


2017-07-08 21:27 GMT+02:00 david marin <davidmar...@gmail.com>:
Sure,

Here you go:

-------------  Scan config
Defining extension
Excluded sources for coverage: 
  **/activities/**
  **/R.*
  **/R$*.*
  **/*$ViewInjector*.*
  **/BuildConfig.*
  **/Manifest*.*
  android/**/*.*
  **/*Injector.*
  **/model/**
  **/*Exception.*
Initializer GenericCoverageSensor
Initializer GenericCoverageSensor (done) | time=0ms

This is a multimodule project so I have many similar blocks (one per project)

Thanks

El vie., 7 jul. 2017 a las 19:43, Julien HENRY (<julien...@sonarsource.com>) escribió:
Hi David,

Could you please enable Gradle info logs (--info) and check that you see the following log for the subprojects where you expect coverage to be excluded:
"Excluded sources for coverage: XXXX"

++


Le lundi 3 juillet 2017 11:48:25 UTC+2, davidmar...@gmail.com a écrit :
Hi Julien,

Any news on this? I can try to give you more info if you need it

Regards

El martes, 27 de junio de 2017, 8:58:15 (UTC+2), Julien HENRY escribió:
Hi David,

We need a bit more details to investigate. How do you set the property? Can you share scanner logs with verbose output?

++

Julien

Le mardi 27 juin 2017 08:50:38 UTC+2, davidmar...@gmail.com a écrit :
Hi guys!

After updating from Sonar 6.2 to Sonar 6.4 the coverage exclusions are not working anymore in my project. I am using the version 2.5 of the gradle plugin and in the sonar scanner context, i can see the property, so it looks like sonarqube is not honoring it.

If I set the property in the sonarqube web it does work. Any ideas about how can I investigate this issue? or workaround it?

Regards


david marin

unread,
Jul 10, 2017, 11:14:52 AM7/10/17
to Julien HENRY, SonarLint
 Hi Julien,

As I have some similar rules on the web, I would put another example from a different module.

Excluded sources for coverage: 
  **/factory/MediaSourceFactory.*
  **/player/SimpleExoPlayerWrapper.*
  **/R.*
  **/R$*.*
  **/*$ViewInjector*.*
  **/BuildConfig.*
  **/Manifest*.*
  android/**/*.*
  **/*Injector.*
  **/model/**
  **/*Exception.*


And in the backend, I am getting this line:
Regards

Julien HENRY

unread,
Jul 10, 2017, 12:42:29 PM7/10/17
to david marin, SonarLint
Hi,

I just made a test, and everything is working fine. Would you be able to create a small reproducer?

++

Julien

Julien Henry | SonarSource

Developer

http://sonarsource.com


--
You received this message because you are subscribed to the Google Groups "SonarLint" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarlint+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarlint/CADLxF16ScMoQO2i4fMbdyXd4rgss2L5VoDuz7pcp_s5ih6CB5Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

david marin

unread,
Jul 13, 2017, 9:20:30 AM7/13/17
to Julien HENRY, SonarLint
Hi Julien, 

I finally have found time to do it, can iIjust attach it in an email or you want me to create a repo somewhere?

Regards

To unsubscribe from this group and stop receiving emails from it, send an email to sonarlint+...@googlegroups.com.

Julien HENRY

unread,
Jul 13, 2017, 9:36:36 AM7/13/17
to david marin, SonarLint
Hi David,

Both ways are fine for me.

++

Julien Henry | SonarSource

Developer

http://sonarsource.com


To unsubscribe from this group and stop receiving emails from it, send an email to sonarlint+unsubscribe@googlegroups.com.

david marin

unread,
Jul 13, 2017, 3:38:30 PM7/13/17
to Julien HENRY, SonarLint
It looks like I can not send the zip by email so there you go a link for it in Google drive


Thanks again
El jue., 13 jul. 2017 16:14, david marin <davidmar...@gmail.com> escribió:
Perfect, 

Please find it attached, and sorry for the delay on getting this done.

Regards,


To unsubscribe from this group and stop receiving emails from it, send an email to sonarlint+...@googlegroups.com.

david marin

unread,
Jul 14, 2017, 8:46:34 AM7/14/17
to Julien HENRY, SonarLint
Hi Julien,

Sorry, this is not to rush you, but I would like to know if you were able to open the link, to upload it somewhere else in another case.

Regards and thanks a lot

Julien HENRY

unread,
Jul 17, 2017, 4:37:01 AM7/17/17
to david marin, SonarLint
Hi David,

Thanks to your reproducer, I managed to understand the issue. I have created a ticket that you can watch/vote for:

In the meantime there is a workaround: you have to define your exclusions on the sonarqube configuration block declared in the root project (ie in build.gradle).

++

Julien Henry | SonarSource

Developer

http://sonarsource.com


To unsubscribe from this group and stop receiving emails from it, send an email to sonarlint+unsubscribe@googlegroups.com.

david marin

unread,
Jul 17, 2017, 7:42:42 AM7/17/17
to Julien HENRY, SonarLint
Thanks a lot Juliet

Regards

To unsubscribe from this group and stop receiving emails from it, send an email to sonarlint+...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages