Multiple test coverage filters not working together

I posted earlier about this and didn’t get a response. This seems like possibly a bug:

I’m trying to add two coverage exclusion rules and they work independently but not together. The first is intended to filter all files that end in “ControllerDocumentation.cs” and the second is intended to filter all files that fall under folders that start with “MyProject.Tests”. The config looks like:

sonar.coverage.exclusions="**/*ControllerDocumentation.cs, **/MyProject.Tests*/**/*"

Any advice?

Hi,

Have you tried setting these through the UI? I know it seems like it should be just the same thing, but all exclusions are actually multi-value settings, which can be tricky to get right via parameters. There’s some slight-of-hand that happens on the back end to allow you to set sonar.coverage.exclusions=**/foo/*.js but it may not be kicking in right with multiple values.

 
Ann

I think you’re talking about this?

When I tried to use that earlier it didn’t work at all (even with just one). I’ll try that again and update you on if it works or not.

@ganncamp Yeah. That didn’t work either. Is there something else I can do to debug this?

Hi,

Just to be sure, you entered one value per input, not the comma-delimited list, right?

 
Ann

@ganncamp That’s right. However, I forgot to remove the configuration from the command line config. Removing that made it work for both. Any insight into why it only works from the UI? I’d like to be able to version control the exclusion rules.

Hi,

All my insight I gave above. :slight_smile:

 
Ann

@ganncamp Gotcha. Well, I appreciate your help and I’m definitely glad I could get it mostly working. Is there someone I could talk to about why the comma-delimited string I provided wasn’t working? Without knowing what the “magic” the UI is doing behind the scenes I’m not really sure how to fully resolve the issue.