What does that mean? What actually happens if someone passes or does not pass the sonar.tests property? Is this a redundant property if I pass sonar.exclusions and sonar.coverage.exclusions property as well?
Can someone please explain the use of these 3 properties like I’m a 5 year old and can someone please help update the official documentation too? The official documentation also does not even mention anything about sonar.coverage.exclusions property.
I will be happy to volunteer and contribute to the documentation if needed.
sonar.sources and sonar.tests are two properties used to define where are your main/business source files and where are your test files in your project.
If you do nothing, by default with the SonarScanner CLI, all source files of your project will be considered as “main” and the specific rules that run on test files won’t be executed.
When you are using the SonarScanner for Maven or Gradle, you have most of the time nothing to do because sonar.sources and sonar.tests are set automatically.
The “inclusions” and “exclusions” properties, are used to fine tune what you want or don’t want to be part of the scope of your scan.
sonar.test.inclusions + sonar.test.exclusions to be used to fine tune the scope of test files to be part of your scan (see documentation of SonarCloud that is more precise than the one of SonarQube for test files: Analysis Scope | SonarCloud Docs)
Warning: there is a typo in the property names you shared, there is no “s” at the end of “sonar.test.xxx”, it’s sonar.test.inclusions and sonar.test.exclusions. I know it’s boring to have such inconsistency in property names, hopefully, we will fix that one day.