Update junit plugin
- update junit plugin to use convert xml - update docstring of junit plugin Change-Id: I47e5ebd159bca869a297cf5f0b85a3d63bb264ac
This commit is contained in:
parent
23cbeda2e9
commit
a463b12f29
@ -1066,14 +1066,14 @@ def junit(registry, xml_parent, data):
|
|||||||
"""yaml: junit
|
"""yaml: junit
|
||||||
Publish JUnit test results.
|
Publish JUnit test results.
|
||||||
|
|
||||||
:arg str results: results filename
|
:arg str results: results filename (required)
|
||||||
:arg bool keep-long-stdio: Retain long standard output/error in test
|
:arg bool keep-long-stdio: Retain long standard output/error in test
|
||||||
results (default true).
|
results (default true).
|
||||||
:arg bool allow-empty-results: Do not fail builds if no junit reports
|
:arg bool allow-empty-results: Do not fail builds if no junit reports
|
||||||
are found (default false)
|
are found (default false)
|
||||||
:arg float health-scale-factor: Amplification factor to apply to test
|
:arg float health-scale-factor: Amplification factor to apply to test
|
||||||
failures when computing the test result contribution to the build health
|
failures when computing the test result contribution to the build
|
||||||
score. (default 1.0)
|
health score. (default 1.0)
|
||||||
:arg bool allow-empty-results: Do not fail the build if the JUnit files are
|
:arg bool allow-empty-results: Do not fail the build if the JUnit files are
|
||||||
missing (default false).
|
missing (default false).
|
||||||
:arg bool test-stability: Add historical information about test
|
:arg bool test-stability: Add historical information about test
|
||||||
@ -1102,15 +1102,15 @@ def junit(registry, xml_parent, data):
|
|||||||
junitresult = XML.SubElement(xml_parent,
|
junitresult = XML.SubElement(xml_parent,
|
||||||
'hudson.tasks.junit.JUnitResultArchiver')
|
'hudson.tasks.junit.JUnitResultArchiver')
|
||||||
junitresult.set('plugin', 'junit')
|
junitresult.set('plugin', 'junit')
|
||||||
XML.SubElement(junitresult, 'testResults').text = data['results']
|
mapping = [
|
||||||
XML.SubElement(junitresult, 'keepLongStdio').text = str(
|
('results', 'testResults', None),
|
||||||
data.get('keep-long-stdio', True)).lower()
|
('keep-long-stdio', 'keepLongStdio', True),
|
||||||
XML.SubElement(junitresult, 'allowEmptyResults').text = str(
|
('health-scale-factor', 'healthScaleFactor', '1.0'),
|
||||||
data.get('allow-empty-results', False)).lower()
|
('allow-empty-results', 'allowEmptyResults', False),
|
||||||
XML.SubElement(junitresult, 'healthScaleFactor').text = str(
|
]
|
||||||
data.get('health-scale-factor', '1.0'))
|
helpers.convert_mapping_to_xml(
|
||||||
XML.SubElement(junitresult, 'allowEmptyResults').text = str(
|
junitresult, data, mapping, fail_required=True)
|
||||||
data.get('allow-empty-results', False)).lower()
|
|
||||||
datapublisher = XML.SubElement(junitresult, 'testDataPublishers')
|
datapublisher = XML.SubElement(junitresult, 'testDataPublishers')
|
||||||
if str(data.get('test-stability', False)).lower() == 'true':
|
if str(data.get('test-stability', False)).lower() == 'true':
|
||||||
XML.SubElement(datapublisher,
|
XML.SubElement(datapublisher,
|
||||||
|
@ -4,7 +4,6 @@
|
|||||||
<hudson.tasks.junit.JUnitResultArchiver plugin="junit">
|
<hudson.tasks.junit.JUnitResultArchiver plugin="junit">
|
||||||
<testResults>nosetests.xml</testResults>
|
<testResults>nosetests.xml</testResults>
|
||||||
<keepLongStdio>true</keepLongStdio>
|
<keepLongStdio>true</keepLongStdio>
|
||||||
<allowEmptyResults>false</allowEmptyResults>
|
|
||||||
<healthScaleFactor>1.0</healthScaleFactor>
|
<healthScaleFactor>1.0</healthScaleFactor>
|
||||||
<allowEmptyResults>false</allowEmptyResults>
|
<allowEmptyResults>false</allowEmptyResults>
|
||||||
<testDataPublishers/>
|
<testDataPublishers/>
|
||||||
|
@ -4,7 +4,6 @@
|
|||||||
<hudson.tasks.junit.JUnitResultArchiver plugin="junit">
|
<hudson.tasks.junit.JUnitResultArchiver plugin="junit">
|
||||||
<testResults>nosetests-example.xml</testResults>
|
<testResults>nosetests-example.xml</testResults>
|
||||||
<keepLongStdio>false</keepLongStdio>
|
<keepLongStdio>false</keepLongStdio>
|
||||||
<allowEmptyResults>true</allowEmptyResults>
|
|
||||||
<healthScaleFactor>2.0</healthScaleFactor>
|
<healthScaleFactor>2.0</healthScaleFactor>
|
||||||
<allowEmptyResults>true</allowEmptyResults>
|
<allowEmptyResults>true</allowEmptyResults>
|
||||||
<testDataPublishers>
|
<testDataPublishers>
|
||||||
|
Loading…
Reference in New Issue
Block a user