xunit publisher was wrong with multiple types

When using multiple xunit publishers such as:

  publishers:
   - xunit:
	  types:
	   - phpunit:
		  pattern: 'junitphp.xml'
	   - cppunit:
		  pattern: 'cppunit.log'

the publisher was wrapping each framework (phpunit, cppunit in above
example) in its own <types /> which is not at all how the Jenkins plugin
does it.

Instead, this patch creates a single <types /> element and attach all
frameworks to it.

Change-Id: I6822d6355e7ba47546f6e959e3d1a160a059243b
This commit is contained in:
Antoine Musso 2013-07-18 09:30:52 +02:00
parent 4aac895619
commit 98bcaefbd4

View File

@ -557,9 +557,9 @@ def xunit(parser, xml_parent, data):
supported_types.append(configured_type)
# Generate XML for each of the supported framework types
xmltypes = XML.SubElement(xunit, 'types')
for supported_type in supported_types:
framework_name = supported_type.keys()[0]
xmltypes = XML.SubElement(xunit, 'types')
xmlframework = XML.SubElement(xmltypes,
types_to_plugin_types[framework_name])