summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhegner <benedikt.hegner@cern.ch>2016-11-29 15:29:57 +0100
committerTodd Gamblin <tgamblin@llnl.gov>2016-11-29 08:29:57 -0600
commita6d579ea150f020ce97b9e87ec7c4ea4393deaec (patch)
tree458324e5a212b7b4991db8e93cea70b7e908a0e3
parent664939eeba8d086106e6154a897214d2da7fe09d (diff)
downloadspack-a6d579ea150f020ce97b9e87ec7c4ea4393deaec.tar.gz
spack-a6d579ea150f020ce97b9e87ec7c4ea4393deaec.tar.bz2
spack-a6d579ea150f020ce97b9e87ec7c4ea4393deaec.tar.xz
spack-a6d579ea150f020ce97b9e87ec7c4ea4393deaec.zip
add headers neede for CDASH to junit output (#2433)
-rw-r--r--lib/spack/spack/cmd/install.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/spack/spack/cmd/install.py b/lib/spack/spack/cmd/install.py
index de45c7ca4f..bc90e488a4 100644
--- a/lib/spack/spack/cmd/install.py
+++ b/lib/spack/spack/cmd/install.py
@@ -26,6 +26,7 @@ import argparse
import codecs
import functools
import os
+import platform
import time
import xml.dom.minidom
import xml.etree.ElementTree as ET
@@ -106,9 +107,10 @@ class TestResult(object):
class TestSuite(object):
- def __init__(self):
+ def __init__(self, spec):
self.root = ET.Element('testsuite')
self.tests = []
+ self.spec = spec
def append(self, item):
if not isinstance(item, TestCase):
@@ -128,6 +130,8 @@ class TestSuite(object):
)
self.root.set('failures', str(number_of_failures))
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:
self.root.append(item.element)
@@ -322,7 +326,7 @@ def install(parser, args, **kwargs):
if not log_filename:
log_filename = default_log_file(spec)
# Create the test suite in which to log results
- test_suite = TestSuite()
+ test_suite = TestSuite(spec)
# Decorate PackageBase.do_install to get installation status
PackageBase.do_install = junit_output(
spec, test_suite