Merge "xunit: support versions 3+"
This commit is contained in:
commit
10500593a0
@ -4694,6 +4694,9 @@ def xunit(registry, xml_parent, data):
|
||||
:language: yaml
|
||||
|
||||
"""
|
||||
info = registry.get_plugin_info("xunit")
|
||||
plugin_version = pkg_resources.parse_version(info.get("version", str(sys.maxsize)))
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
xunit = XML.SubElement(xml_parent, "org.jenkinsci.plugins.xunit.XUnitBuilder")
|
||||
xunit.set("plugin", "xunit")
|
||||
@ -4733,7 +4736,13 @@ def xunit(registry, xml_parent, data):
|
||||
supported_types.append(configured_type)
|
||||
|
||||
# Generate XML for each of the supported framework types
|
||||
xmltypes = XML.SubElement(xunit, "types")
|
||||
# Note: versions 3+ are now using the 'tools' sub-element instead of 'types'
|
||||
if plugin_version < pkg_resources.parse_version("3.0.0"):
|
||||
types_name = "types"
|
||||
else:
|
||||
types_name = "tools"
|
||||
|
||||
xmltypes = XML.SubElement(xunit, types_name)
|
||||
mappings = [
|
||||
("pattern", "pattern", ""),
|
||||
("requireupdate", "failIfNotNew", True),
|
||||
|
@ -1832,6 +1832,9 @@ def xunit(registry, xml_parent, data):
|
||||
:language: yaml
|
||||
|
||||
"""
|
||||
info = registry.get_plugin_info("xunit")
|
||||
plugin_version = pkg_resources.parse_version(info.get("version", str(sys.maxsize)))
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
xunit = XML.SubElement(xml_parent, "xunit")
|
||||
xunit.set("plugin", "xunit")
|
||||
@ -1871,7 +1874,13 @@ def xunit(registry, xml_parent, data):
|
||||
supported_types.append(configured_type)
|
||||
|
||||
# Generate XML for each of the supported framework types
|
||||
xmltypes = XML.SubElement(xunit, "types")
|
||||
# Note: versions 3+ are now using the 'tools' sub-element instead of 'types'
|
||||
if plugin_version < pkg_resources.parse_version("3.0.0"):
|
||||
types_name = "types"
|
||||
else:
|
||||
types_name = "tools"
|
||||
|
||||
xmltypes = XML.SubElement(xunit, types_name)
|
||||
for supported_type in supported_types:
|
||||
framework_name = next(iter(supported_type.keys()))
|
||||
xmlframework = XML.SubElement(xmltypes, types_to_plugin_types[framework_name])
|
||||
|
1
tests/builders/fixtures/xunit-full.plugins_info.yaml
Symbolic link
1
tests/builders/fixtures/xunit-full.plugins_info.yaml
Symbolic link
@ -0,0 +1 @@
|
||||
../../publishers/fixtures/xunit001.plugins_info.yaml
|
1
tests/builders/fixtures/xunit-minimal.plugins_info.yaml
Symbolic link
1
tests/builders/fixtures/xunit-minimal.plugins_info.yaml
Symbolic link
@ -0,0 +1 @@
|
||||
../../publishers/fixtures/xunit001.plugins_info.yaml
|
3
tests/publishers/fixtures/xunit001.plugins_info.yaml
Normal file
3
tests/publishers/fixtures/xunit001.plugins_info.yaml
Normal file
@ -0,0 +1,3 @@
|
||||
- longName: 'xUnit'
|
||||
shortName: 'xunit'
|
||||
version: "2.4.0"
|
1
tests/publishers/fixtures/xunit002.plugins_info.yaml
Symbolic link
1
tests/publishers/fixtures/xunit002.plugins_info.yaml
Symbolic link
@ -0,0 +1 @@
|
||||
xunit001.plugins_info.yaml
|
1
tests/publishers/fixtures/xunit003.plugins_info.yaml
Symbolic link
1
tests/publishers/fixtures/xunit003.plugins_info.yaml
Symbolic link
@ -0,0 +1 @@
|
||||
xunit001.plugins_info.yaml
|
3
tests/publishers/fixtures/xunit004.plugins_info.yaml
Normal file
3
tests/publishers/fixtures/xunit004.plugins_info.yaml
Normal file
@ -0,0 +1,3 @@
|
||||
- longName: 'xUnit'
|
||||
shortName: 'xunit'
|
||||
version: "3.0.0"
|
21
tests/publishers/fixtures/xunit004.xml
Normal file
21
tests/publishers/fixtures/xunit004.xml
Normal file
@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<project>
|
||||
<publishers>
|
||||
<xunit plugin="xunit">
|
||||
<tools>
|
||||
<PHPUnitJunitHudsonTestType>
|
||||
<pattern>junit.log</pattern>
|
||||
<failIfNotNew>true</failIfNotNew>
|
||||
<deleteOutputFiles>true</deleteOutputFiles>
|
||||
<skipNoTestFiles>false</skipNoTestFiles>
|
||||
<stopProcessingIfError>true</stopProcessingIfError>
|
||||
</PHPUnitJunitHudsonTestType>
|
||||
</tools>
|
||||
<thresholds/>
|
||||
<thresholdMode>1</thresholdMode>
|
||||
<extraConfiguration>
|
||||
<testTimeMargin>3000</testTimeMargin>
|
||||
</extraConfiguration>
|
||||
</xunit>
|
||||
</publishers>
|
||||
</project>
|
5
tests/publishers/fixtures/xunit004.yaml
Normal file
5
tests/publishers/fixtures/xunit004.yaml
Normal file
@ -0,0 +1,5 @@
|
||||
publishers:
|
||||
- xunit:
|
||||
types:
|
||||
- phpunit:
|
||||
pattern: "junit.log"
|
Loading…
x
Reference in New Issue
Block a user