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

Test Result Trend chart not showing on Multibranch Pipeline branch if last build has no test results

      I'm not sure if this is a problem in xUnit or pipeline multibranch plugin. Please reassign this as required.

      We've got a Multibranch Pipeline project and we upload various test results using the xUnit plugin. It's somewhat like this:

      stage("Reachable stage") {
          if (some condition)
              return; // Skip all subsequent stages. This appears to cause the problem.
      }
      stage("Potentially failing or unreachable stage") {
          try
          {
              // This might fail and abort consequent stages.
          }
          finally
          {   // We still want all tests and artifacts that we can get, but we only care for artifacts whose unit tests were executed.
              xunit testTimeMargin: '2000', thresholdMode: 1, thresholds: [skipped(failureNewThreshold: '0', failureThreshold: '0', unstableNewThreshold: '0', unstableThreshold: '0'), failed(failureNewThreshold: '0', failureThreshold: '0', unstableNewThreshold: '0', unstableThreshold: '0')], tools: [xUnitDotNet(deleteOutputFiles: true, failIfNotNew: false, pattern: 'unittests.xml', skipNoTestFiles: false, stopProcessingIfError: true)]
              archiveArtifacts artifacts: '...', defaultExcludes: false
              xunit testTimeMargin: '2000', thresholdMode: 1, thresholds: [skipped(failureNewThreshold: '0', failureThreshold: '0', unstableNewThreshold: '0', unstableThreshold: '0'), failed(failureNewThreshold: '0', failureThreshold: '0', unstableNewThreshold: '0', unstableThreshold: '0')], tools: [xUnitDotNet(deleteOutputFiles: true, failIfNotNew: false, pattern: 'boxtests.xml', skipNoTestFiles: false, stopProcessingIfError: true)]
          }
      }
      stage("Potentially unreachable stage") {
      }
      
      

      The trend chart shows up when builds fail with or without tests or succeed with tests, but the chart disappears when the build skips stages which record the tests. To be entirely honest, I'm not sure what the current behavior is exactly (it's inconsistent).

      This should be fixed. As long as there are test results in any builds at all, they should be displayed regardless of test results in the latest build.

          [JENKINS-58960] Test Result Trend chart not showing on Multibranch Pipeline branch if last build has no test results

          Nikolas Falco added a comment - - edited

          The behavior of trend result is part of junit plugin.

          Nikolas Falco added a comment - - edited The behavior of trend result is part of junit plugin.

          Edgars Batna added a comment -

          I tried to locate where the job trend chart disappears, but can't. Can someone point me at where this behavior is exactly so I can nuke it out of existence?

          Edgars Batna added a comment - I tried to locate where the job trend chart disappears, but can't. Can someone point me at where this behavior is exactly so I can nuke it out of existence?

          Nikolas Falco added a comment -

          if the stage is skipped the chart disappear and must be rebuild totally. For what I remember the pipeline step wire TestResult to the stage object and to build the trend it goes in the past build to get records.
          If you want keep the trend result than ensure the stage "Potentially failing or unreachable stage" is always done (or at least done and marked as skipped - gray)

          Nikolas Falco added a comment - if the stage is skipped the chart disappear and must be rebuild totally. For what I remember the pipeline step wire TestResult to the stage object and to build the trend it goes in the past build to get records. If you want keep the trend result than ensure the stage "Potentially failing or unreachable stage" is always done (or at least done and marked as skipped - gray)

          Edgars Batna added a comment -

          From further analysis: https://issues.jenkins.io/browse/JENKINS-68999

          The UI element containing the chart seems to be not loaded, which is not controlled by JUnit or echarts as I see. Maybe you can find out more (see the linked issue)?

          Edgars Batna added a comment - From further analysis: https://issues.jenkins.io/browse/JENKINS-68999 The UI element containing the chart seems to be not loaded, which is not controlled by JUnit or echarts as I see. Maybe you can find out more (see the linked issue)?

            Unassigned Unassigned
            gl1koz3 Edgars Batna
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: