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

Tests duration are 0 at class level in test results recorded from trx file

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Cannot Reproduce
    • Component/s: mstest-plugin
    • Labels:
      None
    • Environment:
      Jenkins 2.45
      mstest-plugin 0.19
    • Similar Issues:

      Description

      Recording test results from trx file well displays test results but durations at class level are always 0 whereas global duration is correct and duration of each test in the class is also correct.

      Could you please have a look on that ?
      (attached example trx file and screenshot)

        Attachments

          Activity

          Hide
          reanto_ch Renato Chencinski added a comment - - edited

          Just found out the problem in my scenario. I had a custom xsl file for formatting the result, used by the xUnit plugin (userContent\xUnit\MSTest\mstest-to-junit.xsl), which was causing the problem (probably got there around 2014, when it might have been needed).

          I just removed the file and class duration started appearing again.

          Hopefully this info helps someone else.

          Show
          reanto_ch Renato Chencinski added a comment - - edited Just found out the problem in my scenario. I had a custom xsl file for formatting the result, used by the xUnit plugin (userContent\xUnit\MSTest\mstest-to-junit.xsl), which was causing the problem (probably got there around 2014, when it might have been needed). I just removed the file and class duration started appearing again. Hopefully this info helps someone else.
          Hide
          notdifficult Not Diff added a comment - - edited

          My junitResult.xml differs from this one https://github.com/jenkinsci/junit-plugin/blob/master/src/test/resources/hudson/tasks/junit/junitResult.xml

          because I only a have single <suite> element.

           

          It seems that the first <duration> sub-element (0.0 for me) is shown as duration for ALL classes in the class test overview (as shown in attachment 2017-02-13_1451.png). This can't be right, can it?

          Show
          notdifficult Not Diff added a comment - - edited My junitResult.xml differs from this one https://github.com/jenkinsci/junit-plugin/blob/master/src/test/resources/hudson/tasks/junit/junitResult.xml because I only a have single <suite> element.   It seems that the first <duration> sub-element (0.0 for me) is shown as duration for ALL classes in the class test overview (as shown in attachment 2017-02-13_1451.png). This can't be right, can it?
          Hide
          notdifficult Not Diff added a comment -

          I have exactly the same problem. What kind of information do you need to reproduce?

          I am using a German locale on an English installation of Win10. Could it be a locale problem?

          Running Jenkins as service as normal user.

          Using latest Jenkins version 2.89.2, mstest is at 0.23.

          My tests use a base class and [ClassInitialize] methods. [TestInitialize] methods is implemented in base class. Could this setup cause a problem?

           

          This result file looks odd to me. Should the times not be in seconds? My tests take definitely longer than 0, 0.05 and 0.3.

          d:\Program Files (x86)\Jenkins\jobs\test-project\builds\77\junitResult.xml

           

           <?xml version='1.0' encoding='UTF-8'?>
          <result plugin="junit@1.22.2">
          <suites>
          <suite>
          <file>d:\DAT\Jenkins\workspace\test-project\temporary-junit-reports\TEST-0.xml</file>
          <name>MSTestSuite</name>
          <duration>0.0</duration>
          <time>0</time>
          <enclosingBlocks/>
          <enclosingBlockNames/>
          <cases>
          <case>
          <duration>0.0547418</duration>
          <className>LibraryTest.ListTest</className>
          <testName>TestRelativeListItem</testName>
          <skipped>false</skipped>
          <failedSince>0</failedSince>
          </case>
          <case>
          <duration>0.0317896</duration>

          ...

           

          What could I do to help debugging the problem? Is there a log which would help? Where?

          Show
          notdifficult Not Diff added a comment - I have exactly the same problem. What kind of information do you need to reproduce? I am using a German locale on an English installation of Win10. Could it be a locale problem? Running Jenkins as service as normal user. Using latest Jenkins version 2.89.2, mstest is at 0.23. My tests use a base class and [ClassInitialize] methods. [TestInitialize] methods is implemented in base class. Could this setup cause a problem?   This result file looks odd to me. Should the times not be in seconds? My tests take definitely longer than 0, 0.05 and 0.3. d:\Program Files (x86)\Jenkins\jobs\test-project\builds\77\junitResult.xml    <?xml version='1.0' encoding='UTF-8'?> <result plugin="junit@1.22.2"> <suites> <suite> <file>d:\DAT\Jenkins\workspace\test-project\temporary-junit-reports\TEST-0.xml</file> <name>MSTestSuite</name> <duration> 0.0 </duration> <time> 0 </time> <enclosingBlocks/> <enclosingBlockNames/> <cases> <case> <duration> 0.0547418 </duration> <className>LibraryTest.ListTest</className> <testName>TestRelativeListItem</testName> <skipped>false</skipped> <failedSince>0</failedSince> </case> <case> <duration> 0.0317896 </duration> ...   What could I do to help debugging the problem? Is there a log which would help? Where?
          Hide
          nilleb Ivo Bellin Salarin added a comment - - edited

          Sorry, but I can't reproduce this issue (please have a look at the attached screenshot)

           

          Update: well, today JIRA doesn't allow me to upload files. You will be able to find it on http://pub.nilleb.com, mstest-plugin folder.

          Show
          nilleb Ivo Bellin Salarin added a comment - - edited Sorry, but I can't reproduce this issue (please have a look at the attached screenshot)   Update: well, today JIRA doesn't allow me to upload files. You will be able to find it on http://pub.nilleb.com,  mstest-plugin folder.

            People

            • Assignee:
              nilleb Ivo Bellin Salarin
              Reporter:
              splashnenen Alexandre Aubert
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: