Update xunit plugin
- update xunit plugin to use convert xml - add plugin="xunit" attribute - update docstring Change-Id: Iee5fd66434d3ca2acbe13b0871c085b6fb5d9a62
This commit is contained in:
parent
e1de6f22ff
commit
0c1856b696
|
@ -1246,12 +1246,12 @@ def xunit(registry, xml_parent, data):
|
||||||
``gtest``, ``junit``, ``mstest``, ``nunit``, ``phpunit``, ``tusar``,
|
``gtest``, ``junit``, ``mstest``, ``nunit``, ``phpunit``, ``tusar``,
|
||||||
``unittest``, and ``valgrind``.
|
``unittest``, and ``valgrind``.
|
||||||
|
|
||||||
The 'custom' type is not supported.
|
The 'custom' type is not supported.
|
||||||
|
|
||||||
:type (`dict`): each type can be configured using the following:
|
:type (`dict`): each type can be configured using the following:
|
||||||
|
|
||||||
* **pattern** (`str`): An Ant pattern to look for Junit result
|
* **pattern** (`str`): An Ant pattern to look for Junit result
|
||||||
files, relative to the workspace root.
|
files, relative to the workspace root (default '')
|
||||||
* **requireupdate** (`bool`): fail the build whenever fresh tests
|
* **requireupdate** (`bool`): fail the build whenever fresh tests
|
||||||
results have not been found (default true).
|
results have not been found (default true).
|
||||||
* **deleteoutput** (`bool`): delete temporary JUnit files
|
* **deleteoutput** (`bool`): delete temporary JUnit files
|
||||||
|
@ -1269,6 +1269,7 @@ def xunit(registry, xml_parent, data):
|
||||||
"""
|
"""
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
xunit = XML.SubElement(xml_parent, 'xunit')
|
xunit = XML.SubElement(xml_parent, 'xunit')
|
||||||
|
xunit.set('plugin', 'xunit')
|
||||||
|
|
||||||
# Map our internal types to the XML element names used by Jenkins plugin
|
# Map our internal types to the XML element names used by Jenkins plugin
|
||||||
types_to_plugin_types = {
|
types_to_plugin_types = {
|
||||||
|
@ -1312,17 +1313,17 @@ def xunit(registry, xml_parent, data):
|
||||||
xmlframework = XML.SubElement(xmltypes,
|
xmlframework = XML.SubElement(xmltypes,
|
||||||
types_to_plugin_types[framework_name])
|
types_to_plugin_types[framework_name])
|
||||||
|
|
||||||
XML.SubElement(xmlframework, 'pattern').text = (
|
mappings = [
|
||||||
supported_type[framework_name].get('pattern', ''))
|
('pattern', 'pattern', ''),
|
||||||
XML.SubElement(xmlframework, 'failIfNotNew').text = str(
|
('requireupdate', 'failIfNotNew', True),
|
||||||
supported_type[framework_name].get('requireupdate', True)).lower()
|
('deleteoutput', 'deleteOutputFiles', True),
|
||||||
XML.SubElement(xmlframework, 'deleteOutputFiles').text = str(
|
('skip-if-no-test-files', 'skipNoTestFiles', False),
|
||||||
supported_type[framework_name].get('deleteoutput', True)).lower()
|
('stoponerror', 'stopProcessingIfError', True),
|
||||||
XML.SubElement(xmlframework, 'skipNoTestFiles').text = str(
|
]
|
||||||
supported_type[framework_name].get('skip-if-no-test-files',
|
helpers.convert_mapping_to_xml(xmlframework,
|
||||||
False)).lower()
|
supported_type[framework_name],
|
||||||
XML.SubElement(xmlframework, 'stopProcessingIfError').text = str(
|
mappings,
|
||||||
supported_type[framework_name].get('stoponerror', True)).lower()
|
fail_required=True)
|
||||||
|
|
||||||
xmlthresholds = XML.SubElement(xunit, 'thresholds')
|
xmlthresholds = XML.SubElement(xunit, 'thresholds')
|
||||||
for t in data.get('thresholds', []):
|
for t in data.get('thresholds', []):
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<project>
|
<project>
|
||||||
<publishers>
|
<publishers>
|
||||||
<xunit>
|
<xunit plugin="xunit">
|
||||||
<types>
|
<types>
|
||||||
<PHPUnitJunitHudsonTestType>
|
<PHPUnitJunitHudsonTestType>
|
||||||
<pattern>junit.log</pattern>
|
<pattern>junit.log</pattern>
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<project>
|
<project>
|
||||||
<publishers>
|
<publishers>
|
||||||
<xunit>
|
<xunit plugin="xunit">
|
||||||
<types>
|
<types>
|
||||||
<CTestType>
|
<CTestType>
|
||||||
<pattern>build/tests/reports/ctest.xml</pattern>
|
<pattern>build/tests/reports/ctest.xml</pattern>
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<project>
|
<project>
|
||||||
<publishers>
|
<publishers>
|
||||||
<xunit>
|
<xunit plugin="xunit">
|
||||||
<types>
|
<types>
|
||||||
<PHPUnitJunitHudsonTestType>
|
<PHPUnitJunitHudsonTestType>
|
||||||
<pattern>junit.log</pattern>
|
<pattern>junit.log</pattern>
|
||||||
|
|
Loading…
Reference in New Issue