Open xiezhenye opened 6 years ago
It seems properties file can not contains comments, after remove comments, this Exception not occurs. But I got another Exception:
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 7.844s
INFO: Final Memory: 48M/264M
INFO: ------------------------------------------------------------------------
ERROR: Error during SonarQube Scanner execution
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at java.lang.String.substring(String.java:1960)
at fr.univartois.sonargo.gotest.FunctionFinder.searchInLine(FunctionFinder.java:72)
at fr.univartois.sonargo.gotest.FunctionFinder.lambda$searchFunctionInFile$2(FunctionFinder.java:41)
at java.util.Iterator.forEachRemaining(Iterator.java:116)
at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:580)
at fr.univartois.sonargo.gotest.FunctionFinder.searchFunctionInFile(FunctionFinder.java:40)
at fr.univartois.sonargo.gotest.FunctionFinder.lambda$searchFunction$1(FunctionFinder.java:30)
at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184)
at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175)
at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
at java.util.Iterator.forEachRemaining(Iterator.java:116)
at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151)
at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418)
at fr.univartois.sonargo.gotest.FunctionFinder.searchFunction(FunctionFinder.java:28)
at fr.univartois.sonargo.gotest.GoTestSensor.execute(GoTestSensor.java:61)
at org.sonar.scanner.sensor.SensorWrapper.analyse(SensorWrapper.java:53)
at org.sonar.scanner.phases.SensorsExecutor.executeSensor(SensorsExecutor.java:88)
at org.sonar.scanner.phases.SensorsExecutor.execute(SensorsExecutor.java:82)
at org.sonar.scanner.phases.SensorsExecutor.execute(SensorsExecutor.java:68)
at org.sonar.scanner.phases.AbstractPhaseExecutor.execute(AbstractPhaseExecutor.java:78)
at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:179)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:144)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:129)
at org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:261)
at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:256)
at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:245)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:144)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:129)
at org.sonar.scanner.task.ScanTask.execute(ScanTask.java:47)
at org.sonar.scanner.task.TaskContainer.doAfterStart(TaskContainer.java:84)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:144)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:129)
at org.sonar.scanner.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:119)
at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:116)
at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:63)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
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:233)
at org.sonarsource.scanner.api.EmbeddedScanner.runAnalysis(EmbeddedScanner.java:151)
at org.sonarsource.scanner.cli.Main.runAnalysis(Main.java:123)
at org.sonarsource.scanner.cli.Main.execute(Main.java:77)
at org.sonarsource.scanner.cli.Main.main(Main.java:61)
ERROR:
ERROR: Re-run SonarQube Scanner using the -X switch to enable full debug logging.
@xiezhenye the first issue you noticed was related to the comments we added in the properties file to explain the values of the properties.
We updated the README to make comments compatible with Java properties file.
The second issue is different. I renamed the current issue with that problem.
The plugin can not recognize the name of your test function.
This is an example of test function that can be recognized.
func TestAverage(t *testing.T){
}
Can you upload or show a part of a test file ?
@thibaultfalque we should make sure the code does not break if the function is not recognized.
The code need to check for potential -1 index and live with that.
I will fix.
Please check release 1.2.11-RC8.
@xiezhenye could you close the issue if the problem is resolved ?
@xiezhenye could you close the issue if the problem is resolved ?
Description
Got java.io.FileNotFoundException, but the path of report.xml exists.
Steps to Reproduce
Content of your sonar-project.properties
Log of sonar-scanner related to the plugin
Versions
Versions of your sonar installation (server, sonar-scanner), gometalinter, go and OS. sonar-golang v1.2.11-rc7 SonarQube Scanner 3.0.3.778 Java 1.8.0_73 Oracle Corporation (64-bit) Mac OS X 10.13.2 x86_64 go 1.9.1
Additional Information
The file
/Users/xiezhenye/Documents/work/xzy/march/report.xml
is really exists.