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

Test duration is always displayed as <1s

    Details

    • Similar Issues:

      Description

      I have BlueOcean 1.7.1

      I have a job which generates test results into JUnit xml format, and then the JUnit xml is parsed by Jenkins.

       

      If I go to:

      https://myhost/blue/organizations/jenkins/MYTEST/detail/MYTEST/23/tests

       

      Each test is listed as taking <1s

      However, if I go to the classic UI, the correct test durations are displayed.

       

        Attachments

          Issue Links

            Activity

            Hide
            rodrigc Craig Rodrigues added a comment -

            Here is an example JUnit report.xml file.  In classic UI, it displays the proper test duration.  In Blue Ocean test UI,

            the test duration is wrong.

            Show
            rodrigc Craig Rodrigues added a comment - Here is an example JUnit report.xml file.  In classic UI, it displays the proper test duration.  In Blue Ocean test UI, the test duration is wrong.
            Hide
            rodrigc Craig Rodrigues added a comment - - edited

            I built blueocean-plugin and did some debugging.

             

            On this line:

            https://github.com/jenkinsci/blueocean-plugin/blob/b02273dc2a6aee295ac8bd7dbab8eb3a8516a60e/blueocean-dashboard/src/main/js/components/testing/TestCaseResultRow.jsx#L24

             

             const duration = TimeDuration.format(testCase.duration, translation, locale);

             

            the first argument to TimeDuration.format() needs to be milliseconds:

             

            https://github.com/jenkinsci/blueocean-plugin/blob/b02273dc2a6aee295ac8bd7dbab8eb3a8516a60e/jenkins-design-language/src/js/components/TimeDuration.jsx#L82

            but it is actually seconds:

            Show
            rodrigc Craig Rodrigues added a comment - - edited I built blueocean-plugin and did some debugging.   On this line: https://github.com/jenkinsci/blueocean-plugin/blob/b02273dc2a6aee295ac8bd7dbab8eb3a8516a60e/blueocean-dashboard/src/main/js/components/testing/TestCaseResultRow.jsx#L24     const duration = TimeDuration.format(testCase.duration, translation, locale);   the first argument to TimeDuration.format() needs to be milliseconds:   https://github.com/jenkinsci/blueocean-plugin/blob/b02273dc2a6aee295ac8bd7dbab8eb3a8516a60e/jenkins-design-language/src/js/components/TimeDuration.jsx#L82 but it is actually seconds:
            Hide
            rodrigc Craig Rodrigues added a comment -

            https://github.com/jenkinsci/blueocean-plugin/pull/1794

             

             

            With this fix, the test report viewer in Blue Ocean matches the timestamps reported by the classic UI test reporter.

            Show
            rodrigc Craig Rodrigues added a comment - https://github.com/jenkinsci/blueocean-plugin/pull/1794     With this fix, the test report viewer in Blue Ocean matches the timestamps reported by the classic UI test reporter.
            Hide
            rodrigc Craig Rodrigues added a comment -
            Show
            rodrigc Craig Rodrigues added a comment - Fix has been merged: https://github.com/jenkinsci/blueocean-plugin/pull/1794    

              People

              • Assignee:
                rodrigc Craig Rodrigues
                Reporter:
                rodrigc Craig Rodrigues
              • Votes:
                1 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: