Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-68020

Set canScanConsoleLog to false for CargoCheckParser

    XMLWordPrintable

Details

    Description

      Pipeline:

          stage('Rustfmt') {
            steps {
              sh '''
                rustup component add rustfmt
                cargo fmt --all -- --check || true
              '''
            }
            post {
              always {
                recordIssues tools: [cargo()]
              }
            }
          } 

      Stacktrace:

      java.lang.ClassCastException: class java.lang.String cannot be cast to class org.json.JSONObject (java.lang.String is in module java.base of loader 'bootstrap'; org.json.JSONObject is in unnamed module of loader jenkins.util.AntClassLoader @25d46436)
      	at edu.hm.hafner.analysis.parser.CargoCheckParser.lambda$parse$0(CargoCheckParser.java:75)
      	at java.base/java.util.stream.ReferencePipeline$3$1.accept(Unknown Source)
      	at java.base/java.util.stream.ReferencePipeline$3$1.accept(Unknown Source)
      	at java.base/java.util.Iterator.forEachRemaining(Unknown Source)
      	at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Unknown Source)
      	at java.base/java.util.stream.AbstractPipeline.copyInto(Unknown Source)
      	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
      	at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(Unknown Source)
      	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(Unknown Source)
      	at java.base/java.util.stream.AbstractPipeline.evaluate(Unknown Source)
      	at java.base/java.util.stream.ReferencePipeline.forEach(Unknown Source)
      	at edu.hm.hafner.analysis.parser.CargoCheckParser.parse(CargoCheckParser.java:79)
      	at io.jenkins.plugins.analysis.core.model.ReportScanningTool.scanInConsoleLog(ReportScanningTool.java:191)
      	at io.jenkins.plugins.analysis.core.model.ReportScanningTool.scan(ReportScanningTool.java:138)
      	at io.jenkins.plugins.analysis.core.model.ReportScanningTool.scan(ReportScanningTool.java:130)
      	at io.jenkins.plugins.analysis.core.steps.IssuesScanner.scan(IssuesScanner.java:101)
      	at io.jenkins.plugins.analysis.core.steps.IssuesRecorder.scanWithTool(IssuesRecorder.java:793)
      	at io.jenkins.plugins.analysis.core.steps.IssuesRecorder.record(IssuesRecorder.java:757)
      	at io.jenkins.plugins.analysis.core.steps.IssuesRecorder.perform(IssuesRecorder.java:726)
      	at io.jenkins.plugins.analysis.core.steps.RecordIssuesStep$Execution.run(RecordIssuesStep.java:1139)
      	at io.jenkins.plugins.analysis.core.steps.RecordIssuesStep$Execution.run(RecordIssuesStep.java:1097)
      	at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
      	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
      	at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
      	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
      	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
      	at java.base/java.lang.Thread.run(Unknown Source) 

      Attachments

        Activity

          halkeye Gavin Mogan added a comment -

          :facepalm: i missed the "message format json" bit

          halkeye Gavin Mogan added a comment - :facepalm: i missed the "message format json" bit
          drulli Ulli Hafner added a comment -

          The cargo parser works on a JSON file. So you need to pipe your output to a file and use that as input to the warnings plugin. Otherwise the output is interleaved with console log messages (which are not JSON).

          drulli Ulli Hafner added a comment - The cargo parser works on a JSON file. So you need to pipe your output to a file and use that as input to the warnings plugin. Otherwise the output is interleaved with console log messages (which are not JSON).

          People

            Unassigned Unassigned
            halkeye Gavin Mogan
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: