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

Nunit plugin in raises exception if there are no tests in nunit xml

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved (View Workflow)
    • Major
    • Resolution: Fixed
    • nunit-plugin
    • None
    • nunit 0.17, jenkins 1.651.1

    Description

      I recently upgraded jenkins and all our plugins and some of our builds are failing.

      After investigation it turns out that we produce some nunit test xml files that have no test results in (we might have set a test to [Ignore] temporarily for example).

      These used to work, and now do not.

      Example xml:

      <?xml version="1.0" encoding="UTF-8"?><testsuite errors="0" failures="0" name="RES.Coordinate.Calculation.Test.TurkeyTest" skipped="1" tests="1" time="">
      <testcase classname="RES.Coordinate.Calculation.Test.TurkeyTest" name="ED1950_to_WGS84("T1",556351,4611739,27.67626007d,41.65371627d)">
      <skipped message=""/>
      </testcase>
      </testsuite>

      The output is as follows:

      Recording NUnit tests results
      ERROR: Step ‘Publish NUnit test result report’ aborted due to exception:
      java.io.IOException: Failed to read D:\EX00_WS\temporary-junit-reports\TEST-RES.Coordinate.Calculation.Test.TurkeyTest_2.xml
      at hudson.tasks.junit.TestResult.parse(TestResult.java:306)
      at hudson.tasks.junit.TestResult.parsePossiblyEmpty(TestResult.java:244)
      at hudson.tasks.junit.TestResult.parse(TestResult.java:175)
      at hudson.tasks.junit.TestResult.parse(TestResult.java:154)
      at hudson.tasks.junit.TestResult.<init>(TestResult.java:126)
      at hudson.plugins.nunit.NUnitPublisher$1.invoke(NUnitPublisher.java:202)
      at hudson.plugins.nunit.NUnitPublisher$1.invoke(NUnitPublisher.java:191)
      at hudson.FilePath.act(FilePath.java:990)
      at hudson.FilePath.act(FilePath.java:968)
      at hudson.plugins.nunit.NUnitPublisher.getTestResult(NUnitPublisher.java:191)
      at hudson.plugins.nunit.NUnitPublisher.recordTestResult(NUnitPublisher.java:147)
      at hudson.plugins.nunit.NUnitPublisher.perform(NUnitPublisher.java:109)
      at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:45)
      at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:782)
      at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:723)
      at hudson.model.Build$BuildExecution.post2(Build.java:185)
      at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:668)
      at hudson.model.Run.execute(Run.java:1763)
      at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      at hudson.model.ResourceController.execute(ResourceController.java:98)
      at hudson.model.Executor.run(Executor.java:410)
      Caused by: java.lang.NumberFormatException: empty String
      at sun.misc.FloatingDecimal.readJavaFormatString(Unknown Source)
      at sun.misc.FloatingDecimal.parseFloat(Unknown Source)
      at java.lang.Float.parseFloat(Unknown Source)
      at hudson.tasks.junit.SuiteResult.<init>(SuiteResult.java:170)
      at hudson.tasks.junit.SuiteResult.parseSuite(SuiteResult.java:144)
      at hudson.tasks.junit.SuiteResult.parse(SuiteResult.java:129)
      at hudson.tasks.junit.TestResult.parse(TestResult.java:301)
      ... 20 more
      Build result "FAILURE". Skipping script.

      Cheers

      Cedd

      Attachments

        Activity

          cedd cedd burge created issue -
          rtyler R. Tyler Croy made changes -
          Field Original Value New Value
          Workflow JNJira [ 170569 ] JNJira + In-Review [ 183959 ]
          slide_o_mix Alex Earl made changes -
          Assignee Bruno P. Kinoshita [ kinow ] Alex Earl [ slide_o_mix ]
          slide_o_mix Alex Earl made changes -
          Resolution Fixed [ 1 ]
          Status Open [ 1 ] Resolved [ 5 ]

          People

            slide_o_mix Alex Earl
            cedd cedd burge
            Votes:
            1 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: