add headers neede for CDASH to junit output (#2433)
This commit is contained in:
parent
664939eeba
commit
a6d579ea15
@ -26,6 +26,7 @@
|
|||||||
import codecs
|
import codecs
|
||||||
import functools
|
import functools
|
||||||
import os
|
import os
|
||||||
|
import platform
|
||||||
import time
|
import time
|
||||||
import xml.dom.minidom
|
import xml.dom.minidom
|
||||||
import xml.etree.ElementTree as ET
|
import xml.etree.ElementTree as ET
|
||||||
@ -106,9 +107,10 @@ class TestResult(object):
|
|||||||
|
|
||||||
|
|
||||||
class TestSuite(object):
|
class TestSuite(object):
|
||||||
def __init__(self):
|
def __init__(self, spec):
|
||||||
self.root = ET.Element('testsuite')
|
self.root = ET.Element('testsuite')
|
||||||
self.tests = []
|
self.tests = []
|
||||||
|
self.spec = spec
|
||||||
|
|
||||||
def append(self, item):
|
def append(self, item):
|
||||||
if not isinstance(item, TestCase):
|
if not isinstance(item, TestCase):
|
||||||
@ -128,6 +130,8 @@ def dump(self, filename):
|
|||||||
)
|
)
|
||||||
self.root.set('failures', str(number_of_failures))
|
self.root.set('failures', str(number_of_failures))
|
||||||
self.root.set('tests', str(len(self.tests)))
|
self.root.set('tests', str(len(self.tests)))
|
||||||
|
self.root.set('name', str(self.spec))
|
||||||
|
self.root.set('hostname', platform.node())
|
||||||
|
|
||||||
for item in self.tests:
|
for item in self.tests:
|
||||||
self.root.append(item.element)
|
self.root.append(item.element)
|
||||||
@ -322,7 +326,7 @@ def install(parser, args, **kwargs):
|
|||||||
if not log_filename:
|
if not log_filename:
|
||||||
log_filename = default_log_file(spec)
|
log_filename = default_log_file(spec)
|
||||||
# Create the test suite in which to log results
|
# Create the test suite in which to log results
|
||||||
test_suite = TestSuite()
|
test_suite = TestSuite(spec)
|
||||||
# Decorate PackageBase.do_install to get installation status
|
# Decorate PackageBase.do_install to get installation status
|
||||||
PackageBase.do_install = junit_output(
|
PackageBase.do_install = junit_output(
|
||||||
spec, test_suite
|
spec, test_suite
|
||||||
|
Loading…
Reference in New Issue
Block a user