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

Warnings Plugin Native Format cannot scan console log output

      Have configured an issue recorder for the native format according to the docs in https://github.com/jenkinsci/warnings-ng-plugin/blob/master/doc/Documentation.md#export-your-issues-into-a-supported-format

      recordIssues(tool: issues()) 

      However, the build breaks with the error:

      java.lang.AssertionError: Static analysis tool Warnings Plugin Native Format cannot scan console log output, please define a file pattern
      	at edu.hm.hafner.util.Ensure.throwException(Ensure.java:169)
      	at edu.hm.hafner.util.Ensure.access$000(Ensure.java:36)
      	at edu.hm.hafner.util.Ensure$BooleanCondition.isTrue(Ensure.java:724)
      	at io.jenkins.plugins.analysis.core.model.ReportScanningTool.scanInConsoleLog(ReportScanningTool.java:164)
      	at io.jenkins.plugins.analysis.core.model.ReportScanningTool.scan(ReportScanningTool.java:123)
      	at io.jenkins.plugins.analysis.core.steps.IssuesScanner.scan(IssuesScanner.java:101)
      	at io.jenkins.plugins.analysis.core.steps.IssuesRecorder.scanWithTool(IssuesRecorder.java:666)
      	at io.jenkins.plugins.analysis.core.steps.IssuesRecorder.record(IssuesRecorder.java:631)
      	at io.jenkins.plugins.analysis.core.steps.IssuesRecorder.perform(IssuesRecorder.java:602)
      	at io.jenkins.plugins.analysis.core.steps.RecordIssuesStep$Execution.run(RecordIssuesStep.java:1007)
      	at io.jenkins.plugins.analysis.core.steps.RecordIssuesStep$Execution.run(RecordIssuesStep.java:969)
      	at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      	at java.lang.Thread.run(Thread.java:748)

      Thats not what I would have expected form the docs. 

      The console log contains entries like these:

      [testReportI18n] Jun 09, 2020 10:48:44 AM Log
      [testReportI18n] SEVERE: {"fileName":"D:\Jenkins\workspace\BI-Reports_General_Reports_trunk\report\Relation Matrix\Relation_Matrix.jrxml","severity":"ERROR","lineStart":1,"description":"(en) missing key 'relation.matrix.object'"}
      

      Is this a problem?

          [JENKINS-62630] Warnings Plugin Native Format cannot scan console log output

          Ulli Hafner added a comment -

          Since JSON and XML reports are typically better stored in files, I de-activated the possibility to scan for warnings in the console using these parsers. Can't you export the JSON part into a separate file? And then call

          recordIssues(tool: issues(pattern: '**/your-report.json')) 
          

          Ulli Hafner added a comment - Since JSON and XML reports are typically better stored in files, I de-activated the possibility to scan for warnings in the console using these parsers. Can't you export the JSON part into a separate file? And then call recordIssues(tool: issues(pattern: '**/your-report.json'))

          Yes, I can, no problem. I even configured a GroovyParser now. But I would not have taken that path, if the documentation would not have directed me into the wrong direction.
          Would be nice if you could change the documentation to reflect the new behavior.

          Markus Schlegel added a comment - Yes, I can, no problem. I even configured a GroovyParser now. But I would not have taken that path, if the documentation would not have directed me into the wrong direction. Would be nice if you could change the documentation to reflect the new behavior.

          Ulli Hafner added a comment -

          Pull requests are welcome

          Ulli Hafner added a comment - Pull requests are welcome

            Unassigned Unassigned
            schlegel_m Markus Schlegel
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: