Uploaded image for project: 'SonarSwift'
  1. SonarSwift
  2. SONARSWIFT-452

Properly report error when directory provided to import coverage and not fail the analysis

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.3
    • Component/s: Coverage, Plugin
    • Labels:
      None

      Description

      When sonar.swift.coverage.reportPaths is set to the directory (while it should be the list of files) analysis will fail with some unclear stacktrace (Swift analyzer is obfuscated).

      2020-07-03T12:36:57.2983080Z 12:36:57.298 INFO: ------------------------------------------------------------------------
      2020-07-03T12:36:57.2985110Z 12:36:57.298 INFO: EXECUTION FAILURE
      2020-07-03T12:36:57.2985780Z 12:36:57.298 INFO: ------------------------------------------------------------------------
      2020-07-03T12:36:57.2986150Z 12:36:57.298 INFO: Total time: 44.150s
      2020-07-03T12:36:57.4653270Z 12:36:57.465 INFO: Final Memory: 41M/314M
      2020-07-03T12:36:57.4657990Z 12:36:57.465 INFO: ------------------------------------------------------------------------
      2020-07-03T12:36:57.4658210Z 12:36:57.465 ERROR: Error during SonarScanner execution
      2020-07-03T12:36:57.4665070Z java.io.UncheckedIOException: java.io.IOException: Is a directory
      2020-07-03T12:36:57.4665610Z 	at java.io.BufferedReader$1.hasNext(BufferedReader.java:574)
      2020-07-03T12:36:57.4665990Z 	at java.util.Iterator.forEachRemaining(Iterator.java:115)
      2020-07-03T12:36:57.4666390Z 	at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
      2020-07-03T12:36:57.4667560Z 	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482)
      2020-07-03T12:36:57.4681200Z 	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472)
      2020-07-03T12:36:57.4681730Z 	at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
      2020-07-03T12:36:57.4682360Z 	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
      2020-07-03T12:36:57.4682490Z 	at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:566)
      2020-07-03T12:36:57.4682620Z 	at com.sonar.swift.plugin.B.A(Unknown Source)
      2020-07-03T12:36:57.4682740Z 	at com.sonar.swift.plugin.B.A(Unknown Source)
      2020-07-03T12:36:57.4682850Z 	at com.sonar.swift.plugin.E.A(Unknown Source)
      2020-07-03T12:36:57.4682970Z 	at com.sonar.swift.plugin.E.execute(Unknown Source)
      2020-07-03T12:36:57.4683100Z 	at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:34)
      2020-07-03T12:36:57.4683230Z 	at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:78)
      2020-07-03T12:36:57.4683360Z 	at org.sonar.scanner.sensor.ModuleSensorsExecutor.lambda$execute$1(ModuleSensorsExecutor.java:51)
      2020-07-03T12:36:57.4683490Z 	at org.sonar.scanner.sensor.ModuleSensorsExecutor.withModuleStrategy(ModuleSensorsExecutor.java:69)
      2020-07-03T12:36:57.4683630Z 	at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:51)
      2020-07-03T12:36:57.4683760Z 	at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:68)
      2020-07-03T12:36:57.4683900Z 	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:122)
      2020-07-03T12:36:57.4684020Z 	at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:108)
      2020-07-03T12:36:57.4684150Z 	at org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:418)
      2020-07-03T12:36:57.4684280Z 	at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:414)
      2020-07-03T12:36:57.4684400Z 	at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:372)
      2020-07-03T12:36:57.4684530Z 	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:122)
      2020-07-03T12:36:57.4684650Z 	at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:108)
      2020-07-03T12:36:57.4684780Z 	at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart(GlobalContainer.java:126)
      2020-07-03T12:36:57.4684900Z 	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:122)
      2020-07-03T12:36:57.4685210Z 	at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:108)
      2020-07-03T12:36:57.4685380Z 	at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:58)
      2020-07-03T12:36:57.4685510Z 	at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:52)
      2020-07-03T12:36:57.4685640Z 	at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46)
      2020-07-03T12:36:57.4685760Z 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2020-07-03T12:36:57.4685940Z 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      2020-07-03T12:36:57.4686130Z 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      2020-07-03T12:36:57.4686300Z 	at java.lang.reflect.Method.invoke(Method.java:498)
      2020-07-03T12:36:57.4686440Z 	at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
      2020-07-03T12:36:57.4686570Z 	at com.sun.proxy.$Proxy0.execute(Unknown Source)
      2020-07-03T12:36:57.4686690Z 	at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:189)
      2020-07-03T12:36:57.4686810Z 	at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:138)
      2020-07-03T12:36:57.4686930Z 	at org.sonarsource.scanner.cli.Main.execute(Main.java:112)
      2020-07-03T12:36:57.4687050Z 	at org.sonarsource.scanner.cli.Main.execute(Main.java:75)
      2020-07-03T12:36:57.4687170Z 	at org.sonarsource.scanner.cli.Main.main(Main.java:61)
      2020-07-03T12:36:57.4687280Z Caused by: java.io.IOException: Is a directory
      2020-07-03T12:36:57.4687390Z 	at sun.nio.ch.FileDispatcherImpl.read0(Native Method)
      2020-07-03T12:36:57.4687500Z 	at sun.nio.ch.FileDispatcherImpl.read(FileDispatcherImpl.java:46)
      2020-07-03T12:36:57.4687800Z 	at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223)
      2020-07-03T12:36:57.4687920Z 	at sun.nio.ch.IOUtil.read(IOUtil.java:197)
      2020-07-03T12:36:57.4688030Z 	at sun.nio.ch.FileChannelImpl.read(FileChannelImpl.java:159)
      2020-07-03T12:36:57.4688150Z 	at sun.nio.ch.ChannelInputStream.read(ChannelInputStream.java:65)
      2020-07-03T12:36:57.4688270Z 	at sun.nio.ch.ChannelInputStream.read(ChannelInputStream.java:109)
      2020-07-03T12:36:57.4688390Z 	at sun.nio.ch.ChannelInputStream.read(ChannelInputStream.java:103)
      2020-07-03T12:36:57.4688520Z 	at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:284)
      2020-07-03T12:36:57.4688630Z 	at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:326)
      2020-07-03T12:36:57.4688750Z 	at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:178)
      2020-07-03T12:36:57.4688860Z 	at java.io.InputStreamReader.read(InputStreamReader.java:184)
      2020-07-03T12:36:57.4688980Z 	at java.io.BufferedReader.fill(BufferedReader.java:161)
      2020-07-03T12:36:57.4689100Z 	at java.io.BufferedReader.readLine(BufferedReader.java:324)
      2020-07-03T12:36:57.4689220Z 	at java.io.BufferedReader.readLine(BufferedReader.java:389)
      2020-07-03T12:36:57.4689330Z 	at java.io.BufferedReader$1.hasNext(BufferedReader.java:571)
      

      What's interesting that there is even no log that import of coverage is started (as it's done inside the main sensor).

        Attachments

          Activity

            People

            Assignee:
            massimo.paladin Massimo PALADIN
            Reporter:
            elena.vilchik Elena Vilchik
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Due:
              Created:
              Updated:
              Resolved: