Impact of the sonar.tests parameter


The SonarQube documentation says very little about the the sonar.tests parameter, only that it is a “comma-separated paths to directories containing test source files”. I’d like to know how it actually impacts the analysis, in what aspects the specified directory are treated differently by the engine. (e.g. are they automatically excluded from code coverage calculations ? do they get different quality rules checked, etc.)


1 Like


Yes, and to some degree yes (altho that may change in the future). Additionally, I believe tests are excluded from Lines of Code and Duplications calculations. And finally, you get a different icon in the UI when we know it’s a test file.


Great. Thanks Ann :+1: