Versions:
- SonarScanner 4.7.0.2747
- SonarQube Server / 9.5.0.56709
What are you trying to achieve:
I’m trying to separate with Analysis Scope, the Main code of my application and the Test code by using this configuration at sonar-project.properties
:
sonar.sources=.
sonar.tests=.
sonar.test.inclusions=**/tests/**/*,**/*.test.tsx
With this configuration, the SonarScanner could filter correctly the files, as listed in the logs:
...
INFO: Indexing files...
INFO: Project configuration:
INFO: Excluded sources: **/tests/**/*, **/*.test.tsx
INFO: Included tests: **/tests/**/*, **/*.test.tsx
INFO: 320 files indexed... (last one was frontend/app/Dockerfile)
INFO: 359 files indexed
INFO: 184458 files ignored because of inclusion/exclusion patterns
INFO: 184097 files ignored because of scm ignore settings
...
INFO: Sensor Python Sensor [python]
INFO: Starting global symbols computation
INFO: 92 source files to be analyzed
INFO: 92/92 source files have been analyzed
INFO: Starting rules execution
INFO: 92 source files to be analyzed
INFO: 92/92 source files have been analyzed
INFO: Starting test sources highlighting
INFO: 23 source files to be analyzed
INFO: 23/23 source files have been analyzed
INFO: Sensor Python Sensor [python] (done) | time=1923ms
...
INFO: Starting analysis with current program
INFO: Analyzed 12 file(s) with current program
INFO: Creating TypeScript program
INFO: TypeScript configuration file [REDACTED]
INFO: Creating TypeScript program (done) | time=1799ms
INFO: Starting analysis with current program
INFO: 114/139 files analyzed, current file: [REDACTED]
INFO: Analyzed 127 file(s) with current program
INFO: 139/139 source files have been analyzed
INFO: Sensor TypeScript analysis [javascript] (done) | time=12529ms
There are some other files that are analyzed, but I think these are enough…
But when I go to the Issues, there is no Test code files listed:
And when I remove the filter, they appear as Main code:
What could be happening?