-
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