-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Quarkus JaCoCo - Generated jacoco.xml is not parseable anymore by the sonar-maven-plugin #37544
Comments
/cc @quarkusio/devtools (maven) |
Do some of your tests use |
Yes, the application sources use both the annotations ( |
And BTW, with this new version of Quarkus, the quarkus-jacoco generated report is also incorrect (with 0% coverage) for a maven-multi-module setup ( maven-surefire & maven-failsafe are configured as per the Quarkus documentation: https://quarkus.io/guides/tests-with-coverage ) |
I actually ran into this when I recently introduced sonar scanning into the Quarkus superheroes sample application. Those projects integrate all kinds of tests:
Out of the box I did see the error that @bchetty describes. I don't know if it would have worked in a Quarkus version before 3.6.0 as I only did all this on 3.6.0. This gives me a full representation of the coverage of a Quarkus application. I've even combined it with Quarkus Quinoa for an app that has both a backend and a React front-end. The backend & frontend coverage reports are combined into a single report (see https://sonarcloud.io/project/overview?id=quarkusio-quarkus-super-heroes_ui-super-heroes for the output and https://github.com/quarkusio/quarkus-super-heroes/blob/main/.github/workflows/sonar-scan.yml#L67-L88 for the scanning setup while also adding https://github.com/edeandrea/quarkus-super-heroes/blob/02ffe115b817fef0859852565222b86eb551d971/ui-super-heroes/src/main/webui/package.json#L19). How much of this is required vs gaps in the documentation I'm not sure, but as of right now with Quarkus 3.6.0 (& 3.6.1) this works and sonar understands it. Including coverage for both unit & integration testsWhen you run the build to include coverage for both unit & integration tests you have to build with the I also had to adjust the https://github.com/quarkusio/quarkus-super-heroes/blob/main/.github/workflows/sonar-scan.yml is the GitHub action which performs the scan (in case you're interested). https://sonarcloud.io/organizations/quarkusio-quarkus-super-heroes is the project dashboard on SonarCloud.
|
Same issue for my side with quarkus 3.6.0 |
The problem should be fixed in this PR #37570 |
That will be part of 3.6.2. |
Yes of course, when will the version 3.6.2 be released ? |
3.6.2 should be available on Wednesday, maybe even already tomorrow evening. |
@famod I confirm the problem is fixed in the version 3.6.3 |
Nice, thanks for reporting back @amkac! |
PS: Actually fixed in 3.6.2, but I'd strongly suggest to avoid 3.6.2 because of a config regression. |
Dependabot (on Github Enterprise) is not yet picking up the latest version...I will test it from my side and update the ticket. Thanks :) |
I just tested that and it's working. Thank you for the fix! :) |
Describe the bug
Since Quarkus-3.6.0, the generated jacoco.xml is not "Parseable" by the sonar-maven-plugin. Below is the StackTrace:
Error: Coverage report '/__w/<GITHUB-WORKSPACE>/<GIT-REPO>/target/jacoco-report/jacoco.xml' could not be read/imported. Error: {} java.lang.IllegalStateException: Failed to parse JaCoCo XML report: /__w/<GITHUB-WORKSPACE>/<GIT-REPO>/target/jacoco-report/jacoco.xml at org.snar.plugins.jacoco.XmlReportParser.parse(XmlReportParser.java:108) at org.sonar.plugins.jacoco.JacocoSensor.importReport(JacocoSensor.java:72) at org.sonar.plugins.jacoco.JacocoSensor.importReports(JacocoSensor.java:64) at org.sonar.plugins.jacoco.JacocoSensor.execute(JacocoSensor.java:55) at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:64) at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:88) at org.sonar.scanner.sensor.ModuleSensorsExecutor.lambda$execute$1(ModuleSensorsExecutor.java:61) at org.sonar.scanner.sensor.ModuleSensorsExecutor.withModuleStrategy(ModuleSensorsExecutor.java:79) at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:61) at org.sonar.scanner.scan.SpringModuleScanContainer.doAfterStart(SpringModuleScanContainer.java:82) at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:188) at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:167) at org.sonar.scanner.scan.SpringProjectScanContainer.scan(SpringProjectScanContainer.java:403) at org.sonar.scanner.scan.SpringProjectScanContainer.scanRecursively(SpringProjectScanContainer.java:399) at org.sonar.scanner.scan.SpringProjectScanContainer.doAfterStart(SpringProjectScanContainer.java:368) at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:188) at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:167) at org.sonar.scanner.bootstrap.SpringGlobalContainer.doAfterStart(SpringGlobalContainer.java:137) at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:188) at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:167) at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:72) at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:66) at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:568) at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60) at jdk.proxy4/jdk.proxy4.$Proxy27.execute(Unknown Source) at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:189) at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:138) at org.sonarsource.scanner.maven.bootstrap.ScannerBootstrapper.execute(ScannerBootstrapper.java:64) at org.sonarsource.scanner.maven.SonarQubeMojo.execute(SonarQubeMojo.java:108) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:1***) at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2(MojoExecutor.java:328) at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute(MojoExecutor.java:316) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:174) at org.apache.maven.lifecycle.internal.MojoExecutor.access$000(MojoExecutor.java:75) at org.apache.maven.lifecycle.internal.MojoExecutor$1.run(MojoExecutor.java:162) at org.apache.maven.plugin.DefaultMojosExecutionStrategy.execute(DefaultMojosExecutionStrategy.java:39) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:159) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:105) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:73) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:53) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:***8) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:***1) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:173) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:101) at org.apache.maven.cli.MavenCli.execute(MavenCli.java:906) at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:283) at org.apache.maven.cli.MavenCli.main(MavenCli.java:206) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:568) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:282) at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:225) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:406) at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:347) Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[1,8202] Message: Element type "counter" must be followed by either attribute specifications, ">" or "/>". at java.xml/com.sun.org.apache.xerces.internal.impl.XMLStreamReaderImpl.next(XMLStreamReaderImpl.java:652) at org.sonar.plugins.jacoco.XmlReportParser.parse(XmlReportParser.java:61) ... 59 common frames omitted
Expected behavior
The generated jacoco.xml should be "Parseable" by the sonar-plugin for publishing the report.
Actual behavior
Since Quarkus-3.6.0, the generated jacoco.xml is not "Parseable" by the sonar-maven-plugin.
How to Reproduce?
Reproducer:
Steps to reproduce the bug:
Output of
uname -a
orver
No response
Output of
java -version
17
Quarkus version or git rev
3.6.0
Build tool (ie. output of
mvnw --version
orgradlew --version
)maven 3.8.1
Additional information
Sonar maven plugin ( org.sonarsource.scanner.maven:sonar-maven-plugin) version: 3.10.0.2594
The text was updated successfully, but these errors were encountered: