Skip to content

Commit 2c1ac7c

Browse files
committed
Generate package test CDash output to flag packages with no tests
1 parent ec03ceb commit 2c1ac7c

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

lib/spack/spack/reporters/cdash.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,8 @@ def extract_standalone_test_data(self, package, phases, report_data):
341341
testing['starttime'] = self.starttime
342342
testing['endtime'] = self.starttime
343343
testing['generator'] = self.generator
344-
testing['parts'] = extract_test_parts(package['stdout'].splitlines())
344+
testing['parts'] = extract_test_parts(
345+
package['name'], package['stdout'].splitlines())
345346

346347
def report_test_data(self, directory_name, package, phases, report_data):
347348
"""Generate and upload the test report(s) for the package."""

lib/spack/spack/reporters/extract.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ def status(line):
103103
return stat.lower()
104104

105105

106-
def extract_test_parts(outputs):
106+
def extract_test_parts(default_name, outputs):
107107
parts = []
108108
part = {}
109109
testdesc = ''
@@ -185,4 +185,15 @@ def extract_test_parts(outputs):
185185
# Process the last lingering part IF it didn't generate status
186186
process_part_end(part, curr_time, last_time)
187187

188+
# If no parts, create a skeleton to flag that the tests are not run
189+
if not parts:
190+
part = new_part()
191+
stat = 'notrun'
192+
part['command'] = 'Not Applicable'
193+
part['completed'] = completed[stat]
194+
part['elapsed'] = 0.0
195+
part['name'] = default_name
196+
part['status'] = stat
197+
parts.append(part)
198+
188199
return parts

0 commit comments

Comments
 (0)