Impact of the sonar.tests parameter

Hello,

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.)

Thanks

1 Like

Hi,

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.

 
HTH,
Ann

Great. Thanks Ann :+1: