Merge "publishers: xunit doesn't accepts integers as threshold"

This commit is contained in:
Jenkins 2015-11-12 19:03:02 +00:00 committed by Gerrit Code Review
commit e5ee0ce002
5 changed files with 59 additions and 17 deletions

View File

@ -1103,7 +1103,7 @@ def xunit(parser, xml_parent, data):
# Normalize and craft the element name for this threshold
elname = "%sThreshold" % threshold_name.lower().replace(
'new', 'New')
XML.SubElement(el, elname).text = threshold_value
XML.SubElement(el, elname).text = str(threshold_value)
# Whether to use percent of exact number of tests.
# Thresholdmode is either:

View File

@ -27,16 +27,16 @@
</types>
<thresholds>
<org.jenkinsci.plugins.xunit.threshold.FailedThreshold>
<unstableThreshold/>
<unstableNewThreshold/>
<failureThreshold/>
<failureNewThreshold/>
<unstableThreshold>0</unstableThreshold>
<unstableNewThreshold>0</unstableNewThreshold>
<failureThreshold>0</failureThreshold>
<failureNewThreshold>0</failureNewThreshold>
</org.jenkinsci.plugins.xunit.threshold.FailedThreshold>
<org.jenkinsci.plugins.xunit.threshold.SkippedThreshold>
<unstableThreshold/>
<unstableNewThreshold/>
<failureThreshold/>
<failureNewThreshold/>
<unstableThreshold>0</unstableThreshold>
<unstableNewThreshold>0</unstableNewThreshold>
<failureThreshold>0</failureThreshold>
<failureNewThreshold>0</failureNewThreshold>
</org.jenkinsci.plugins.xunit.threshold.SkippedThreshold>
</thresholds>
<thresholdMode>2</thresholdMode>

View File

@ -4,15 +4,15 @@ publishers:
thresholdmode: 'number'
thresholds:
- failed:
unstable: '1'
unstablenew: '2'
failure: '3'
failurenew: '4'
unstable: 1
unstablenew: 2
failure: 3
failurenew: 4
- skipped:
unstable: '5'
unstablenew: '6'
failure: '7'
failurenew: '8'
unstable: 5
unstablenew: 6
failure: 7
failurenew: 8
types:
- ctest:
pattern: "build/tests/reports/ctest.xml"

View File

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<project>
<publishers>
<xunit>
<types>
<PHPUnitJunitHudsonTestType>
<pattern>junit.log</pattern>
<failIfNotNew>true</failIfNotNew>
<deleteOutputFiles>true</deleteOutputFiles>
<skipNoTestFiles>false</skipNoTestFiles>
<stopProcessingIfError>true</stopProcessingIfError>
</PHPUnitJunitHudsonTestType>
</types>
<thresholds>
<org.jenkinsci.plugins.xunit.threshold.FailedThreshold>
<unstableThreshold>10</unstableThreshold>
<failureThreshold>5</failureThreshold>
</org.jenkinsci.plugins.xunit.threshold.FailedThreshold>
<org.jenkinsci.plugins.xunit.threshold.SkippedThreshold>
<unstableNewThreshold>5</unstableNewThreshold>
<failureNewThreshold>10</failureNewThreshold>
</org.jenkinsci.plugins.xunit.threshold.SkippedThreshold>
</thresholds>
<thresholdMode>1</thresholdMode>
<extraConfiguration>
<testTimeMargin>3000</testTimeMargin>
</extraConfiguration>
</xunit>
</publishers>
</project>

View File

@ -0,0 +1,12 @@
publishers:
- xunit:
thresholds:
- failed:
unstable: 10
failure: 5
- skipped:
unstablenew: 5
failurenew: 10
types:
- phpunit:
pattern: "junit.log"