Iain macLeish created JENKINS-14052:
---------------------------------------

             Summary: xUnit fails with NumberFormatException if threshold 
fields filled out in a certain way
                 Key: JENKINS-14052
                 URL: https://issues.jenkins-ci.org/browse/JENKINS-14052
             Project: Jenkins
          Issue Type: Bug
          Components: xunit
    Affects Versions: current
            Reporter: Iain macLeish
            Assignee: Gregory Boissinot
            Priority: Minor


xUnit crashes with the following exception:

[xUnit] [INFO] - Starting to record.
[xUnit] [INFO] - Processing CppUnit-1.12.1 (default)
[xUnit] [INFO] - [CppUnit-1.12.1 (default)] - 1 test report file(s) were found 
with the pattern '**/src/associates/bnS3/Debug/result.xml' relative to 
'C:\Jenkins\jobs\S3 Test\workspace' for the testing framework 'CppUnit-1.12.1 
(default)'.
[xUnit] [INFO] - Check 'Failed Tests' threshold.
ERROR: Publisher org.jenkinsci.plugins.xunit.XUnitPublisher aborted due to 
exception
java.lang.NumberFormatException: For input string: ""
        at java.lang.NumberFormatException.forInputString(Unknown Source)
        at java.lang.Integer.parseInt(Unknown Source)
        at java.lang.Integer.parseInt(Unknown Source)
        at 
org.jenkinsci.plugins.xunit.threshold.XUnitThreshold.convertToInteger(XUnitThreshold.java:134)
        at 
org.jenkinsci.plugins.xunit.threshold.XUnitThreshold.getResultThresholdNumber(XUnitThreshold.java:80)
        at 
org.jenkinsci.plugins.xunit.threshold.FailedThreshold.getResultThresholdNumber(FailedThreshold.java:34)
        at 
org.jenkinsci.plugins.xunit.XUnitPublisher.processResultThreshold(XUnitPublisher.java:354)
        at 
org.jenkinsci.plugins.xunit.XUnitPublisher.getResultWithThreshold(XUnitPublisher.java:338)
        at 
org.jenkinsci.plugins.xunit.XUnitPublisher.getBuildStatus(XUnitPublisher.java:321)
        at 
org.jenkinsci.plugins.xunit.XUnitPublisher.performXUnit(XUnitPublisher.java:124)
        at 
org.jenkinsci.plugins.xunit.XUnitPublisher.perform(XUnitPublisher.java:92)
        at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19)
        at 
hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:703)
        at 
hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:678)
        at 
hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:656)
        at hudson.model.Build$RunnerImpl.post2(Build.java:162)
        at 
hudson.model.AbstractBuild$AbstractRunner.post(AbstractBuild.java:625)
        at hudson.model.Run.run(Run.java:1435)
        at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
        at hudson.model.ResourceController.execute(ResourceController.java:88)
        at hudson.model.Executor.run(Executor.java:238)
Finished: FAILURE

On line 80 of XUnitThreshold.java the code checks getUnstableNewThreshold() for 
validity, but then attempts to convert getFailureNewThreshold(), so if the 
unstable new field was filled in but failure new field was not, it will cause 
an exception.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.jenkins-ci.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to