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:
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.
@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.
@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.