Skip to content
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

NullPointerException while processing Junit Surefire report #275

Open
4 tasks done
pietrobasso opened this issue Sep 10, 2020 · 1 comment
Open
4 tasks done

NullPointerException while processing Junit Surefire report #275

pietrobasso opened this issue Sep 10, 2020 · 1 comment

Comments

@pietrobasso
Copy link

pietrobasso commented Sep 10, 2020

New Issue Checklist

Issue Description

Inside my sonar-project.properties I correctly specified sonar.swift.surefire.junit.reportsPath=reports/ as my junit reports path. I have a valid TEST-report.xml file (checked with an online html parser and it works).
If I try to run sonar through fastlane, I get the following error:

INFO: Sensor Surefire [backelitesonarswiftplugin]
INFO: Processing Surefire report TEST-report.xml
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 15.690s
INFO: Final Memory: 13M/54M
INFO: ------------------------------------------------------------------------
ERROR: Error during SonarScanner execution
java.lang.NullPointerException
	at java.base/java.text.DecimalFormat.parse(DecimalFormat.java:2139)
	at java.base/java.text.NumberFormat.parse(NumberFormat.java:432)
	at org.sonar.api.utils.ParsingUtils.parseNumber(ParsingUtils.java:47)
	at com.backelite.sonarqube.commons.surefire.SurefireStaxHandler.getTimeAttributeInMS(SurefireStaxHandler.java:125)
	at com.backelite.sonarqube.commons.surefire.SurefireStaxHandler.parseTestResult(SurefireStaxHandler.java:115)
	at com.backelite.sonarqube.commons.surefire.SurefireStaxHandler.parseTestCase(SurefireStaxHandler.java:75)
	at com.backelite.sonarqube.commons.surefire.SurefireStaxHandler.parseTestCase(SurefireStaxHandler.java:58)
	at com.backelite.sonarqube.commons.surefire.SurefireStaxHandler.stream(SurefireStaxHandler.java:48)
	at com.backelite.sonarqube.commons.surefire.StaxParser.parse(StaxParser.java:55)
	at com.backelite.sonarqube.commons.surefire.StaxParser.parse(StaxParser.java:47)
	at com.backelite.sonarqube.commons.surefire.SurefireReportParser.parseFiles(SurefireReportParser.java:92)
	at com.backelite.sonarqube.commons.surefire.SurefireReportParser.parseFiles(SurefireReportParser.java:84)
	at com.backelite.sonarqube.commons.surefire.SurefireReportParser.collect(SurefireReportParser.java:78)
	at com.backelite.sonarqube.commons.surefire.SurefireSensor.execute(SurefireSensor.java:73)
	at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:48)
	at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:85)
	at org.sonar.scanner.sensor.ModuleSensorsExecutor.lambda$execute$1(ModuleSensorsExecutor.java:59)
	at org.sonar.scanner.sensor.ModuleSensorsExecutor.withModuleStrategy(ModuleSensorsExecutor.java:77)
	at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:59)
	at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:82)
	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:137)
	at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:123)
	at org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:388)
	at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:384)
	at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:353)
	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:137)
	at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:123)
	at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart(GlobalContainer.java:144)
	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:137)
	at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:123)
	at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:72)
	at org.sonar.batch.bootstrap
per.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:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:564)
	at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
	at com.sun.proxy.$Proxy0.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.cli.Main.execute(Main.java:112)
	at org.sonarsource.scanner.cli.Main.execute(Main.java:75)
	at org.sonarsource.scanner.cli.Main.main(Main.java:61)
ERROR: 
ERROR: Re-run SonarScanner using the -X switch to enable full debug logging.

My guess is that SurefireReportParser is failing for some reason here:

Command executed

bundle exec fastlane *name of my sonarqube lane*

Environment

sonar-swift 0.4.6
sonarqube 8.4.1.35646
sonar-scanner 4.3.0.2102

@pietrobasso
Copy link
Author

This seems related to #255, no one replied on that though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant