I’m new to SonarCloud and just wanted a little further clarification on how the properties listed in the
sonar-project.properties file works. In particular, how does
sonar.tests work in relation to
sonar.test.inclusions. We came across an issue with the coverage that we fixed but we’re not 100% sure why that fixed it.
Here is an example. We have the following directory structure:
src/[feature]/components src/[feature]/utils src/[feature]/test src/[feature]/index.ts
When we included the following properties into our
sonar-project.properties, the code coverage was not working correctly:
sonar.sources=src sonar.tests=test,src/**/test sonar.test.inclusions=test,src/**/test
To fix the issue we used the following:
sonar.sources=src sonar.tests=test,src sonar.test.inclusions=test,src/**/test
Not exactly sure why that fixed our issue, and not sure if both lines are needed. Would love some help understanding why.
Another side observation, we noticed that the UI (
General Settings > Analysis Scope) did not reflect what was set in the properties file. We ended up clearing everything in the UI and just used the property file.