We had sonarcloud working but we wanted to tweak the code coverage and now sonarcloud is no longer picking up the source code in its analysis.
This was the old configuration
sonar.projectKey=witty-works_nlp_api
sonar.organization=witty-works
sonar.python.version=3.9
sonar.source=app
sonar.source=tests
sonar.python.coverage.reportPaths=coverage.xml
What was odd is that with this configuration it was still including files in the root for code coverage. Now we decided to move all the shell scripts in the root to a “bin” directory. For those files we don’t have tests and therefore we don’t want those files to he included in the code coverage. I updated the configuration and at the same time also fix the typo “sonar.source=tests” to “sonar.tests=tests”.
sonar.projectKey=..
sonar.organization=..
sonar.python.version=3.9
sonar.source=app, bin
sonar.tests=tests
sonar.coverage.exclusions=bin
sonar.python.coverage.reportPaths=coverage.xml
However now the only files that show up in the code tab of my main branch are “tests”. Also all the other quality gates are at A because seemingly its not seeing any code anyway.