Can you add -Dsonar.verbose=true to your analysis command and provide that analysis log?
The analysis / scanner log is what’s output from the analysis command. Hopefully, the log you provide - redacted as necessary - will include that command as well.
[INFO] 11:34:49.433 Importing 1 report(s). Turn your logs in debug mode in order to see the exhaustive list.
[DEBUG] 11:34:49.433 Reading report '/builds/***/***/target/site/jacoco/jacoco.xml'
[INFO] 11:34:50.684 Sensor JaCoCo XML Report Importer [jacoco] (done) | time=1272ms
[INFO] 11:34:50.684 Sensor IaC Docker Sensor [iac]
[INFO] 11:34:50.684 Sensor IaC Docker Sensor is restricted to changed files only
[DEBUG] 11:34:50.691 'src/main/java/com/***/****/utils/test/ex4.groovy' generated metadata with charset 'UTF-8'
[DEBUG] 11:34:50.692 'src/main/java/com/***/****/utils/test/ex1.groovy' generated metadata with charset 'UTF-8'
[DEBUG] 11:34:50.693 'src/main/java/com/***/****/utils/test/ex2.groovy' generated metadata with charset 'UTF-8'
[DEBUG] 11:34:50.695 'src/main/java/com/***/****/utils/test/ex3.groovy' generated metadata with charset 'UTF-8'
[INFO] 11:34:50.781 0 source files to be analyzed
[INFO] 11:34:50.784 0/0 source files have been analyzed
[INFO] 11:34:50.785 Sensor IaC Docker Sensor [iac] (done) | time=101ms
[INFO] 11:34:50.785 Sensor Java Config Sensor [iac]
[INFO] 11:34:50.875 0 source files to be analyzed
[INFO] 11:34:50.875 0/0 source files have been analyzed
[INFO] 11:34:50.875 Sensor Java Config Sensor [iac] (done) | time=90ms
[INFO] 11:34:50.906 Sensor SurefireSensor [java]
[INFO] 11:34:50.907 parsing [/builds/***/****/target/surefire-reports]
[DEBUG] 11:34:51.197 Class not found in resource cache : ***(FQCN)
[DEBUG] 11:34:51.198 Class not found in resource cache : ***(FQCN)
[DEBUG] 11:34:51.198 Class not found in resource cache : ***(FQCN)
[DEBUG] 11:34:51.198 Class not found in resource cache : ***(FQCN)
[DEBUG] 11:34:51.198 Class not found in resource cache : ***(FQCN)
[DEBUG] 11:34:51.198 Resource not found: ***(FQCN)
I found that surefile .xml reports dont finds the compiled classes
Oof. I got what I asked for, didn’t I? (Side note, I’m going to raise the over-the-top verbosity of these verbose logs internally.)
It looks like we’re dealing with analysis of a a PR in which 2 files changed. You said at the beginning, but I’d like to confirm. There are tests for the changed lines in PR? And are those tests new, i.e. added in the PR? Or are they existing tests? (Not, I think, that that should matter.)
I suppose that’s the changed file and its changed (so the tests are new too) test?
We’re not seeing anything about this explicitly in the logs, but a common problem for this symptom is that the paths in the coverage report don’t match the paths the analysis is seeing. Can you take a look at your JaCoCo report and see if the paths look right, relative to where analysis is kicked off from?