Unable to see junit tests results on the dashboard using gradle 7.X scanner on sonarqube 8.9 LTS

  • versions used (SonarQube, Scanner, Plugin, and any relevant extension)
    Sonarqube 8.9.2
    Using docker image gradle:7.3-jdk11
    Sonarqube gradle scanner 3.2.0
    JUnit 5 tests (5.8.2)

  • error observed (wrap logs/code around triple quote ``` for proper formatting)

Configured property “sonar.junit.reportPaths” with “build/test-results/test/” value (this is where the xml files are generated).

The JUnit tests cases do not appear on the dashboard.

The build is performed using gitlab-ci, which finds properly the xml files and report the correct number of tests.

Here are the full logs of the sonarqube task using --info

$ gradle $PROXY $SONARINFO sonarqube --info
2065Initialized native services in: /home/gradle/.gradle/native
2066Initialized jansi services in: /home/gradle/.gradle/native
2067Found daemon DaemonInfo{pid=44, address=[xxxxx port:46051, addresses:[/127.0.0.1]], state=Idle, lastBusy=1640900298195, context=DefaultDaemonContext[uid=xxxxx,javaHome=/opt/java/openjdk,daemonRegistryDir=/home/gradle/.gradle/daemon,pid=44,idleTimeout=10800000,priority=NORMAL,daemonOpts=-XX:MaxMetaspaceSize=256m,-XX:+HeapDumpOnOutOfMemoryError,-Xms256m,-Xmx512m,-Dfile.encoding=UTF-8,-Duser.country=US,-Duser.language=en,-Duser.variant]} however its context does not match the desired criteria.
2068At least one daemon option is different.
2069Wanted: DefaultDaemonContext[uid=null,javaHome=/opt/java/openjdk,daemonRegistryDir=/home/gradle/.gradle/daemon,pid=516,idleTimeout=null,priority=NORMAL,daemonOpts=--add-opens,java.base/java.util=ALL-UNNAMED,--add-opens,java.base/java.lang=ALL-UNNAMED,--add-opens,java.base/java.lang.invoke=ALL-UNNAMED,--add-opens,java.base/java.util=ALL-UNNAMED,--add-opens,java.prefs/java.util.prefs=ALL-UNNAMED,--add-opens,java.prefs/java.util.prefs=ALL-UNNAMED,--add-opens,java.base/java.nio.charset=ALL-UNNAMED,--add-opens,java.base/java.net=ALL-UNNAMED,--add-opens,java.base/java.util.concurrent.atomic=ALL-UNNAMED,-XX:MaxMetaspaceSize=256m,-XX:+HeapDumpOnOutOfMemoryError,-Xms256m,-Xmx512m,-Dfile.encoding=UTF-8,-Duser.country=US,-Duser.language=en,-Duser.variant]
2070Actual: DefaultDaemonContext[uid=fdd2262e-dbe9-45e1-8fdf-1612d2d7689a,javaHome=/opt/java/openjdk,daemonRegistryDir=/home/gradle/.gradle/daemon,pid=44,idleTimeout=10800000,priority=NORMAL,daemonOpts=-XX:MaxMetaspaceSize=256m,-XX:+HeapDumpOnOutOfMemoryError,-Xms256m,-Xmx512m,-Dfile.encoding=UTF-8,-Duser.country=US,-Duser.language=en,-Duser.variant]
2071  Looking for a different daemon...
2072The client will now receive all logging from the daemon (pid: 305). The daemon log file: /home/gradle/.gradle/daemon/7.3.3/daemon-305.out.log
2073Starting 2nd build in daemon [uptime: 15.942 secs, performance: 100%, non-heap usage: 27% of 256 MiB]
2074Using 8 worker leases.
2075Closing daemon's stdin at end of input.
2076The daemon will no longer process any standard input.
2077Not watching /builds/dlbenseignement/TDD2022CODE since the file system is not supported
2078Watching the file system is configured to be enabled if available
2079File system watching is active
2080Starting Build
2081Settings evaluated using settings file '/builds/dlbenseignement/TDD2022CODE/settings.gradle'.
2082Projects loaded. Root project using build file '/builds/dlbenseignement/TDD2022CODE/build.gradle'.
2083Included projects: [root project 'TDD2022CODE']
2084> Configure project :
2085Evaluating root project 'TDD2022CODE' using build file '/builds/dlbenseignement/TDD2022CODE/build.gradle'.
2086All projects evaluated.
2087Selected primary task 'sonarqube' from project :
2088Tasks to be executed: [task ':compileJava', task ':processResources', task ':classes', task ':compileTestJava', task ':sonarqube']
2089Tasks that were excluded: []
2090:compileJava (Thread[Execution worker for ':',5,main]) started.
2091> Task :compileJava UP-TO-DATE
2092Caching disabled for task ':compileJava' because:
2093  Build cache is disabled
2094Skipping task ':compileJava' as it is up-to-date.
2095:compileJava (Thread[Execution worker for ':',5,main]) completed. Took 0.04 secs.
2096:processResources (Thread[Execution worker for ':',5,main]) started.
2097> Task :processResources NO-SOURCE
2098file or directory '/builds/dlbenseignement/TDD2022CODE/src/main/resources', not found
2099Skipping task ':processResources' as it has no source files and no previous output files.
2100:processResources (Thread[Execution worker for ':',5,main]) completed. Took 0.0 secs.
2101:classes (Thread[Execution worker for ':',5,main]) started.
2102> Task :classes UP-TO-DATE
2103Skipping task ':classes' as it has no actions.
2104:classes (Thread[Execution worker for ':',5,main]) completed. Took 0.0 secs.
2105:compileTestJava (Thread[Execution worker for ':',5,main]) started.
2106> Task :compileTestJava UP-TO-DATE
2107Caching disabled for task ':compileTestJava' because:
2108  Build cache is disabled
2109Skipping task ':compileTestJava' as it is up-to-date.
2110:compileTestJava (Thread[Execution worker for ':',5,main]) completed. Took 0.067 secs.
2111:sonarqube (Thread[Execution worker for ':',5,main]) started.
2112> Task :sonarqube
2113Caching disabled for task ':sonarqube' because:
2114  Build cache is disabled
2115Task ':sonarqube' is not up-to-date because:
2116  Task has not declared any outputs despite executing actions.
2117User cache: /root/.sonar/cache
2118Default locale: "en_US", source code encoding: "UTF-8"
2119Load global settings
2120Load global settings (done) | time=353ms
2121Server id: 86E1FA4D-AXxl_8TfaUaQdurn4z8R
2122User cache: /root/.sonar/cache
2123Load/download plugins
2124Load plugins index
2125Load plugins index (done) | time=48ms
2126Plugin [l10nfr] defines 'l10nen' as base plugin. This metadata can be removed from manifest of l10n plugins since version 5.2.
2127Load/download plugins (done) | time=15324ms
2128Process project properties
2129Process project properties (done) | time=5ms
2130Execute project builders
2131Execute project builders (done) | time=1ms
2132Project key: tdd2021_dlbenseignement
2133Base dir: /builds/dlbenseignement/TDD2022CODE
2134Working dir: /builds/dlbenseignement/TDD2022CODE/build/sonar
2135Load project settings for component key: 'tdd2021_dlbenseignement'
2136Load project settings for component key: 'tdd2021_dlbenseignement' (done) | time=31ms
2137Auto-configuring with CI 'Gitlab CI'
2138Load quality profiles
2139Load quality profiles (done) | time=62ms
2140Auto-configuring with CI 'Gitlab CI'
2141Load active rules
2142Load active rules (done) | time=1685ms
2143Indexing files...
2144Project configuration:
214529 files indexed
214629 source files to be analyzed
2147> Task :sonarqube
214822 files ignored because of scm ignore settings
2149Quality profile for java: Sonar way VVL
2150------------- Run sensors on module TDD2021_dlbenseignement
2151Load metrics repository
2152Load metrics repository (done) | time=33ms
2153Sensor JavaSquidSensor [java]
2154Configured Java source version (sonar.java.source): 11
2155JavaClasspath initialization
2156JavaClasspath initialization (done) | time=4ms
2157JavaTestClasspath initialization
2158JavaTestClasspath initialization (done) | time=2ms
2159Java Main Files AST scan
2160Load project repositories
2161Load project repositories (done) | time=29ms
216229/29 source files have been analyzed
21630 source files to be analyzed
21640/0 source files have been analyzed
21650 source files to be analyzed
21660/0 source files have been analyzed
2167> Task :sonarqube
2168Java Main Files AST scan (done) | time=2100ms
2169Java Test Files AST scan
2170Java Test Files AST scan (done) | time=0ms
2171Java Generated Files AST scan
2172Java Generated Files AST scan (done) | time=1ms
2173Sensor JavaSquidSensor [java] (done) | time=2378ms
2174Sensor CoberturaSensor [cobertura]
2175Cobertura report not found at /builds/dlbenseignement/TDD2022CODE/target/site/cobertura/coverage.xml
2176Sensor CoberturaSensor [cobertura] (done) | time=0ms
2177Sensor CSS Rules [cssfamily]
2178No CSS, PHP, HTML or VueJS files are found in the project. CSS analysis is skipped.
2179Sensor CSS Rules [cssfamily] (done) | time=0ms
2180Sensor PmdSensor [pmd]
2181Sensor PmdSensor [pmd] (done) | time=1ms
2182Sensor C# Project Type Information [csharp]
2183Sensor C# Project Type Information [csharp] (done) | time=0ms
2184Sensor C# Properties [csharp]
2185Sensor C# Properties [csharp] (done) | time=1ms
2186Sensor SurefireSensor [java]
2187parsing [/builds/dlbenseignement/TDD2022CODE/build/test-results/test]
2188Sensor SurefireSensor [java] (done) | time=59ms
2189Sensor Removed properties sensor [java]
2190Sensor Removed properties sensor [java] (done) | time=0ms
2191Sensor JavaXmlSensor [java]
2192Sensor JavaXmlSensor [java] (done) | time=1ms
2193Sensor HTML [web]
2194Sensor HTML [web] (done) | time=3ms
2195Sensor VB.NET Project Type Information [vbnet]
2196Sensor VB.NET Project Type Information [vbnet] (done) | time=0ms
2197Sensor VB.NET Properties [vbnet]
2198Sensor VB.NET Properties [vbnet] (done) | time=1ms
2199Sensor SmellMeasuresSensor [smells]
2200Sensor SmellMeasuresSensor [smells] (done) | time=25ms
2201Sensor Clover Coverage Analysis [clover]
2202Clover XML report not found
2203Sensor Clover Coverage Analysis [clover] (done) | time=3ms
2204Sensor JaCoCo XML Report Importer [jacoco]
2205Importing 1 report(s). Turn your logs in debug mode in order to see the exhaustive list.
2206Sensor JaCoCo XML Report Importer [jacoco] (done) | time=26ms
2207Sensor Packages sensor [jdepend]
2208Sensor Packages sensor [jdepend] (done) | time=1ms
2209Sensor FindBugs Sensor [findbugs]
2210Loading findbugs plugin: /builds/dlbenseignement/TDD2022CODE/build/sonar/findbugs/findsecbugs-plugin.jar
2211Findbugs output report: /builds/dlbenseignement/TDD2022CODE/build/sonar/findbugs-result.xml
2212The following classes needed for analysis were missing:
2213  test
2214  makeConcatWithConstants
2215  simpleApply
2216  applyAsInt
2217  apply
2218  compare
2219> Task :sonarqube
2220Sensor FindBugs Sensor [findbugs] (done) | time=3543ms
2221------------- Run sensors on project
2222Sensor Dependency-Check [dependencycheck]
2223Process Dependency-Check report
2224Using JSON-Reportparser
2225Dependency-Check JSON report does not exists. Please check property sonar.dependencyCheck.jsonReportPath:/builds/dlbenseignement/TDD2022CODE/${WORKSPACE}/dependency-check-report.json
2226JSON-Analysis skipped/aborted due to missing report file
2227Using XML-Reportparser
2228Dependency-Check XML report does not exists. Please check property sonar.dependencyCheck.xmlReportPath:/builds/dlbenseignement/TDD2022CODE/${WORKSPACE}/dependency-check-report.xml
2229XML-Analysis skipped/aborted due to missing report file
2230Dependency-Check HTML report does not exists. Please check property sonar.dependencyCheck.htmlReportPath:/builds/dlbenseignement/TDD2022CODE/${WORKSPACE}/dependency-check-report.html
2231HTML-Dependency-Check report does not exist.
2232Process Dependency-Check report (done) | time=3ms
2233Sensor Dependency-Check [dependencycheck] (done) | time=3ms
2234Sensor Zero Coverage Sensor
2235Sensor Zero Coverage Sensor (done) | time=0ms
2236Sensor Java CPD Block Indexer
2237Sensor Java CPD Block Indexer (done) | time=73ms
2238CPD Executor 6 files had no CPD blocks
2239CPD Executor Calculating CPD for 23 files
2240CPD Executor CPD calculation finished (done) | time=8ms
2241> Task :sonarqube
2242Analysis report generated in 48ms, dir size=245 KB
2243Analysis report compressed in 38ms, zip size=92 KB
2244Analysis report uploaded in 57ms
2245ANALYSIS SUCCESSFUL, you can browse https://sonarqube.xxxxx/dashboard?id=tdd2021_dlbenseignement
2246Note that you will be able to access the updated dashboard once the server has processed the submitted analysis report
2247More about the report processing at https://sonarqube.xxxxxxx/api/ce/task?id=AX8H3vgbai9Hgxh_K_G4
2248Analysis total time: 9.526 s
2249:sonarqube (Thread[Execution worker for ':',5,main]) completed. Took 27.939 secs.
2250Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
2251You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
2252See https://docs.gradle.org/7.3.3/userguide/command_line_interface.html#sec:command_line_warnings
2253BUILD SUCCESSFUL in 28s
22543 actionable tasks: 1 executed, 2 up-to-date
2255Some of the file system contents retained in the virtual file system are on file systems that Gradle doesn't support watching. The relevant state was discarded to ensure changes to these locations are properly detected. You can override this by explicitly enabling file system watching.

2256
Uploading artifacts for successful job
00:01
2257Uploading artifacts...
2258build/reports/*: found 120 matching files and directories 
2259Uploading artifacts as "archive" to coordinator... ok  id=57157 responseStatus=201 Created token=ZzeJZHyF
2260Uploading artifacts...
2261build/test-results/test/TEST-*.xml: found 17 matching files and directories 
2262Uploading artifacts as "junit" to coordinator... ok  id=57157 responseStatus=201 Created token=ZzeJZHyF

2263
Cleaning up project directory and file based variables
00:01
2264Job succeeded

Hi,

Welcome to the community!

When in your build process is your JUnit test report generated? I’m not seeing anything in your log between the (skipped) compileTestJava task and analysis.

 
Ann

Hi Ann,

I run a gradle test command before running gradle sonarqube.

Daniel

Hi,

I’m confused. The logs you’ve shown start (more or less) with compiling the code and the tests, then move directly on to anlaysis:

You run your tests before that?

Is it possible that your rest reports are being cleaned out between generation and analysis?

 
Ann

Hi Ann,

Here are the full logs, with tests and sonarqube executed, without the output of the tests.
The tests xml files have not been deleted because they are caught at the end of the script by gitlab-ci to display the results on the job web page.

$ gradle --warning-mode all $PROXY test
30Starting a Gradle Daemon, 6 busy and 2 incompatible and 1 stopped Daemons could not be reused, use --status for details
31> Task :compileJava
32Note: Some input files use unchecked or unsafe operations.
33Note: Recompile with -Xlint:unchecked for details.
34> Task :processResources NO-SOURCE
35> Task :classes
36> Task :cleanTest UP-TO-DATE
37> Task :compileTestJava
38Note: /builds/dlbenseignement/TDD2022CODE/TDD2022TESTS/src/test/java/vvl/lisp/LispParserTest.java uses unchecked or unsafe operations.
39Note: Recompile with -Xlint:unchecked for details.
40> Task :processTestResources
41> Task :testClasses
42> Task :test
43Gradle Test Executor 1 STANDARD_ERROR
44    SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
45    SLF4J: Defaulting to no-operation (NOP) logger implementation
46    SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
47
...
[Tests output removed]
...
2061SUCCESS: Executed 113 tests in 6.9s
2062> Task :jacocoTestReport
2063> Task :copyJBehaveFilesToExpectedLocation NO-SOURCE
2064BUILD SUCCESSFUL in 13s
20656 actionable tasks: 5 executed, 1 up-to-date
2066$ gradle $PROXY $SONARINFO sonarqube --info
2067Initialized native services in: /home/gradle/.gradle/native
2068Initialized jansi services in: /home/gradle/.gradle/native
2069Found daemon DaemonInfo{pid=44, address=[xxxxxx port:46051, addresses:[/127.0.0.1]], state=Idle, lastBusy=1640900298195, context=DefaultDaemonContext[uid=xxxxxxxa,javaHome=/opt/java/openjdk,daemonRegistryDir=/home/gradle/.gradle/daemon,pid=44,idleTimeout=10800000,priority=NORMAL,daemonOpts=-XX:MaxMetaspaceSize=256m,-XX:+HeapDumpOnOutOfMemoryError,-Xms256m,-Xmx512m,-Dfile.encoding=UTF-8,-Duser.country=US,-Duser.language=en,-Duser.variant]} however its context does not match the desired criteria.
2070At least one daemon option is different.
2071Wanted: DefaultDaemonContext[uid=null,javaHome=/opt/java/openjdk,daemonRegistryDir=/home/gradle/.gradle/daemon,pid=512,idleTimeout=null,priority=NORMAL,daemonOpts=--add-opens,java.base/java.util=ALL-UNNAMED,--add-opens,java.base/java.lang=ALL-UNNAMED,--add-opens,java.base/java.lang.invoke=ALL-UNNAMED,--add-opens,java.base/java.util=ALL-UNNAMED,--add-opens,java.prefs/java.util.prefs=ALL-UNNAMED,--add-opens,java.prefs/java.util.prefs=ALL-UNNAMED,--add-opens,java.base/java.nio.charset=ALL-UNNAMED,--add-opens,java.base/java.net=ALL-UNNAMED,--add-opens,java.base/java.util.concurrent.atomic=ALL-UNNAMED,-XX:MaxMetaspaceSize=256m,-XX:+HeapDumpOnOutOfMemoryError,-Xms256m,-Xmx512m,-Dfile.encoding=UTF-8,-Duser.country=US,-Duser.language=en,-Duser.variant]
2072Actual: DefaultDaemonContext[uid=fdd2262e-dbe9-45e1-8fdf-1612d2d7689a,javaHome=/opt/java/openjdk,daemonRegistryDir=/home/gradle/.gradle/daemon,pid=44,idleTimeout=10800000,priority=NORMAL,daemonOpts=-XX:MaxMetaspaceSize=256m,-XX:+HeapDumpOnOutOfMemoryError,-Xms256m,-Xmx512m,-Dfile.encoding=UTF-8,-Duser.country=US,-Duser.language=en,-Duser.variant]
2073  Looking for a different daemon...
2074The client will now receive all logging from the daemon (pid: 306). The daemon log file: /home/gradle/.gradle/daemon/7.3.3/daemon-306.out.log
2075Starting 2nd build in daemon [uptime: 12.994 secs, performance: 99%, non-heap usage: 24% of 256 MiB]
2076Using 8 worker leases.
2077Closing daemon's stdin at end of input.
2078The daemon will no longer process any standard input.
2079Not watching /builds/dlbenseignement/TDD2022CODE since the file system is not supported
2080Watching the file system is configured to be enabled if available
2081File system watching is active
2082Starting Build
2083Settings evaluated using settings file '/builds/dlbenseignement/TDD2022CODE/settings.gradle'.
2084Projects loaded. Root project using build file '/builds/dlbenseignement/TDD2022CODE/build.gradle'.
2085Included projects: [root project 'TDD2022CODE']
2086> Configure project :
2087Evaluating root project 'TDD2022CODE' using build file '/builds/dlbenseignement/TDD2022CODE/build.gradle'.
2088All projects evaluated.
2089Selected primary task 'sonarqube' from project :
2090Tasks to be executed: [task ':compileJava', task ':processResources', task ':classes', task ':compileTestJava', task ':sonarqube']
2091Tasks that were excluded: []
2092:compileJava (Thread[Execution worker for ':',5,main]) started.
2093> Task :compileJava UP-TO-DATE
2094Caching disabled for task ':compileJava' because:
2095  Build cache is disabled
2096Skipping task ':compileJava' as it is up-to-date.
2097:compileJava (Thread[Execution worker for ':',5,main]) completed. Took 0.04 secs.
2098:processResources (Thread[Execution worker for ':',5,main]) started.
2099> Task :processResources NO-SOURCE
2100file or directory '/builds/dlbenseignement/TDD2022CODE/src/main/resources', not found
2101Skipping task ':processResources' as it has no source files and no previous output files.
2102:processResources (Thread[Execution worker for ':',5,main]) completed. Took 0.0 secs.
2103:classes (Thread[Execution worker for ':',5,main]) started.
2104> Task :classes UP-TO-DATE
2105Skipping task ':classes' as it has no actions.
2106:classes (Thread[Execution worker for ':',5,main]) completed. Took 0.0 secs.
2107:compileTestJava (Thread[Execution worker for ':',5,main]) started.
2108> Task :compileTestJava UP-TO-DATE
2109Caching disabled for task ':compileTestJava' because:
2110  Build cache is disabled
2111Skipping task ':compileTestJava' as it is up-to-date.
2112:compileTestJava (Thread[Execution worker for ':',5,main]) completed. Took 0.07 secs.
2113:sonarqube (Thread[Execution worker for ':',5,main]) started.
2114> Task :sonarqube
2115Caching disabled for task ':sonarqube' because:
2116  Build cache is disabled
2117Task ':sonarqube' is not up-to-date because:
2118  Task has not declared any outputs despite executing actions.
2119User cache: /root/.sonar/cache
2120Default locale: "en_US", source code encoding: "UTF-8"
2121Load global settings
2122Load global settings (done) | time=353ms
2123Server id: 86E1FA4D-AXxl_8TfaUaQdurn4z8R
2124User cache: /root/.sonar/cache
2125Load/download plugins
2126Load plugins index
2127Load plugins index (done) | time=44ms
2128Plugin [l10nfr] defines 'l10nen' as base plugin. This metadata can be removed from manifest of l10n plugins since version 5.2.
2129Load/download plugins (done) | time=13463ms
2130Process project properties
2131Process project properties (done) | time=7ms
2132Execute project builders
2133Execute project builders (done) | time=1ms
2134Project key: tdd2021_dlbenseignement
2135Base dir: /builds/dlbenseignement/TDD2022CODE
2136Working dir: /builds/dlbenseignement/TDD2022CODE/build/sonar
2137Load project settings for component key: 'tdd2021_dlbenseignement'
2138Load project settings for component key: 'tdd2021_dlbenseignement' (done) | time=28ms
2139Auto-configuring with CI 'Gitlab CI'
2140Load quality profiles
2141Load quality profiles (done) | time=54ms
2142Auto-configuring with CI 'Gitlab CI'
2143Load active rules
2144Load active rules (done) | time=1602ms
2145Indexing files...
2146Project configuration:
214729 files indexed
214829 source files to be analyzed
2149> Task :sonarqube
215022 files ignored because of scm ignore settings
2151Quality profile for java: Sonar way VVL
2152------------- Run sensors on module TDD2021_dlbenseignement
2153Load metrics repository
2154Load metrics repository (done) | time=32ms
2155Sensor JavaSquidSensor [java]
2156Configured Java source version (sonar.java.source): 11
2157JavaClasspath initialization
2158JavaClasspath initialization (done) | time=4ms
2159JavaTestClasspath initialization
2160JavaTestClasspath initialization (done) | time=2ms
2161Java Main Files AST scan
2162Load project repositories
2163Load project repositories (done) | time=27ms
216429/29 source files have been analyzed
21650 source files to be analyzed
21660/0 source files have been analyzed
21670 source files to be analyzed
21680/0 source files have been analyzed
2169> Task :sonarqube
2170Java Main Files AST scan (done) | time=2056ms
2171Java Test Files AST scan
2172Java Test Files AST scan (done) | time=1ms
2173Java Generated Files AST scan
2174Java Generated Files AST scan (done) | time=0ms
2175Sensor JavaSquidSensor [java] (done) | time=2347ms
2176Sensor CoberturaSensor [cobertura]
2177Cobertura report not found at /builds/dlbenseignement/TDD2022CODE/target/site/cobertura/coverage.xml
2178Sensor CoberturaSensor [cobertura] (done) | time=0ms
2179Sensor CSS Rules [cssfamily]
2180No CSS, PHP, HTML or VueJS files are found in the project. CSS analysis is skipped.
2181Sensor CSS Rules [cssfamily] (done) | time=1ms
2182Sensor PmdSensor [pmd]
2183Sensor PmdSensor [pmd] (done) | time=0ms
2184Sensor C# Project Type Information [csharp]
2185Sensor C# Project Type Information [csharp] (done) | time=0ms
2186Sensor C# Properties [csharp]
2187Sensor C# Properties [csharp] (done) | time=1ms
2188Sensor SurefireSensor [java]
2189parsing [/builds/dlbenseignement/TDD2022CODE/build/test-results/test]
2190Sensor SurefireSensor [java] (done) | time=59ms
2191Sensor Removed properties sensor [java]
2192Sensor Removed properties sensor [java] (done) | time=0ms
2193Sensor JavaXmlSensor [java]
2194Sensor JavaXmlSensor [java] (done) | time=1ms
2195Sensor HTML [web]
2196Sensor HTML [web] (done) | time=3ms
2197Sensor VB.NET Project Type Information [vbnet]
2198Sensor VB.NET Project Type Information [vbnet] (done) | time=0ms
2199Sensor VB.NET Properties [vbnet]
2200Sensor VB.NET Properties [vbnet] (done) | time=1ms
2201Sensor SmellMeasuresSensor [smells]
2202Sensor SmellMeasuresSensor [smells] (done) | time=19ms
2203Sensor Clover Coverage Analysis [clover]
2204Clover XML report not found
2205Sensor Clover Coverage Analysis [clover] (done) | time=3ms
2206Sensor JaCoCo XML Report Importer [jacoco]
2207Importing 1 report(s). Turn your logs in debug mode in order to see the exhaustive list.
2208Sensor JaCoCo XML Report Importer [jacoco] (done) | time=26ms
2209Sensor Packages sensor [jdepend]
2210Sensor Packages sensor [jdepend] (done) | time=1ms
2211Sensor FindBugs Sensor [findbugs]
2212Loading findbugs plugin: /builds/dlbenseignement/TDD2022CODE/build/sonar/findbugs/findsecbugs-plugin.jar
2213Findbugs output report: /builds/dlbenseignement/TDD2022CODE/build/sonar/findbugs-result.xml
2214The following classes needed for analysis were missing:
2215  test
2216  makeConcatWithConstants
2217  simpleApply
2218  applyAsInt
2219  apply
2220  compare
2221> Task :sonarqube
2222Sensor FindBugs Sensor [findbugs] (done) | time=3511ms
2223------------- Run sensors on project
2224Sensor Dependency-Check [dependencycheck]
2225Process Dependency-Check report
2226Using JSON-Reportparser
2227Dependency-Check JSON report does not exists. Please check property sonar.dependencyCheck.jsonReportPath:/builds/dlbenseignement/TDD2022CODE/${WORKSPACE}/dependency-check-report.json
2228JSON-Analysis skipped/aborted due to missing report file
2229Using XML-Reportparser
2230Dependency-Check XML report does not exists. Please check property sonar.dependencyCheck.xmlReportPath:/builds/dlbenseignement/TDD2022CODE/${WORKSPACE}/dependency-check-report.xml
2231XML-Analysis skipped/aborted due to missing report file
2232Dependency-Check HTML report does not exists. Please check property sonar.dependencyCheck.htmlReportPath:/builds/dlbenseignement/TDD2022CODE/${WORKSPACE}/dependency-check-report.html
2233HTML-Dependency-Check report does not exist.
2234Process Dependency-Check report (done) | time=3ms
2235Sensor Dependency-Check [dependencycheck] (done) | time=3ms
2236Sensor Zero Coverage Sensor
2237Sensor Zero Coverage Sensor (done) | time=0ms
2238Sensor Java CPD Block Indexer
2239Sensor Java CPD Block Indexer (done) | time=89ms
2240CPD Executor 6 files had no CPD blocks
2241CPD Executor Calculating CPD for 23 files
2242CPD Executor CPD calculation finished (done) | time=7ms
2243> Task :sonarqube
2244Analysis report generated in 43ms, dir size=245 KB
2245Analysis report compressed in 39ms, zip size=92 KB
2246Analysis report uploaded in 54ms
2247ANALYSIS SUCCESSFUL, you can browse https://sonarqube.xxxxxx/dashboard?id=tdd2021_dlbenseignement
2248Note that you will be able to access the updated dashboard once the server has processed the submitted analysis report
2249More about the report processing at https://sonarqube.xxxxxxx/api/ce/task?id=AX8H7hLfai9Hgxh_K_G6
2250Analysis total time: 9.359 s
2251:sonarqube (Thread[Execution worker for ':',5,main]) completed. Took 25.805 secs.
2252Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
2253You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
2254See https://docs.gradle.org/7.3.3/userguide/command_line_interface.html#sec:command_line_warnings
2255BUILD SUCCESSFUL in 26s
22563 actionable tasks: 1 executed, 2 up-to-date
2257Some of the file system contents retained in the virtual file system are on file systems that Gradle doesn't support watching. The relevant state was discarded to ensure changes to these locations are properly detected. You can override this by explicitly enabling file system watching.

2259
Uploading artifacts for successful job
00:01
2260Uploading artifacts...
2261build/reports/*: found 120 matching files and directories 
2262Uploading artifacts as "archive" to coordinator... ok  id=57159 responseStatus=201 Created token=mBi-1sxz
2263Uploading artifacts...
2264build/test-results/test/TEST-*.xml: found 17 matching files and directories 
2265Uploading artifacts as "junit" to coordinator... ok  id=57159 responseStatus=201 Created token=mBi-1sxz

2267
Cleaning up project directory and file based variables
00:01
2269Job succeeded

Hi,

Thanks for the full log. I’m not seeing anything in it about the JUnit report, which makes me wonder whether that parameter you’ve defined is being picked up. Where/how do you define it? Could you try adding -Dsonar.scanner.dumpToFile=[file path] to the analysis command line so we can make sure it’s being picked up?

 
Ann

Here is the dump file.

sonardump.txt (12.5 KB)

I set sonar properties in build.gradle:

sonarqube {
    properties {
        property "sonar.sourceEncoding", "UTF-8"
        property "sonar.junit.reportPaths","build/test-results/test/"
        property "sonar.jacoco.reportPaths","build/reports/jacoco/test/"
        property "dc5.mutationAnalysis.pitest.sensor.reports.directory","build/reports/pitest/"

    }
}

Hi,

First, you need to invalidate the token in that file, if you haven’t already. :slightly_smiling_face:

And thanks for the file. In fact, I see two relevant properties there:

sonar.junit.reportsPath=/builds/dlbenseignement/TDD2022CODE/build/test-results/test
sonar.junit.reportPaths=build/test-results/test/

The first one isn’t valid, but if I’m right, neither points to a file. Can you adjust to drop reportsPath and point reportPaths to a file?

 
Ann

I am not generating the first property. I guess it is generated by sonarqube gradle.

The reportsPath is there for backward compatibility:

Hi,

Thanks for finding that. Can you try pointing the parameter to a file rather than a directory? I know the code seems to indicate a directory is needed, but the docs say the property should point to a file.

 
Ann

Well, it does not make sense to use a file, since each test file results is located in 13 different xml files.

The issue is the constant TEST_RESULT_FILE_PATTERN with is associated to “TESTS?-.*\.xml”

while in my case the files are generated as TEST-xxxx.xml (no S).

My mistake, did not see the ?, TEST-xxx.xml is accepted.