Skip to content
Snippets Groups Projects
Commit ae0ba373 authored by Zack Galbreath's avatar Zack Galbreath Committed by Todd Gamblin
Browse files

CDash report for concretization errors

Capture any concretization errors and record them in a CTest Update.xml file.
parent d7581697
Branches
Tags
No related merge requests found
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
import spack.cmd.common.arguments as arguments import spack.cmd.common.arguments as arguments
import spack.fetch_strategy import spack.fetch_strategy
import spack.report import spack.report
from spack.error import SpackError
description = "build and install packages" description = "build and install packages"
...@@ -203,7 +204,11 @@ def install(parser, args, **kwargs): ...@@ -203,7 +204,11 @@ def install(parser, args, **kwargs):
for spec in specs: for spec in specs:
spack.package_testing.test(spec.name) spack.package_testing.test(spec.name)
try:
specs = spack.cmd.parse_specs(args.package, concretize=True) specs = spack.cmd.parse_specs(args.package, concretize=True)
except SpackError as e:
reporter.concretization_report(e.message)
raise
# 2. Concrete specs from yaml files # 2. Concrete specs from yaml files
for file in args.specfiles: for file in args.specfiles:
......
...@@ -360,6 +360,24 @@ def cdash_build_report(self, report_data): ...@@ -360,6 +360,24 @@ def cdash_build_report(self, report_data):
t = env.get_template(phase_template) t = env.get_template(phase_template)
f.write(t.render(report_data)) f.write(t.render(report_data))
def concretization_report(self, msg):
if not self.format_name == 'cdash':
return
report_data = {}
report_data['starttime'] = self.starttime
report_data['endtime'] = self.starttime
self.cdash_initialize_report(report_data)
report_data['msg'] = msg
env = spack.tengine.make_environment()
update_template = os.path.join(templates[self.format_name],
'Update.xml')
t = env.get_template(update_template)
output_filename = os.path.join(self.filename, 'Update.xml')
with open(output_filename, 'w') as f:
f.write(t.render(report_data))
def __exit__(self, exc_type, exc_val, exc_tb): def __exit__(self, exc_type, exc_val, exc_tb):
if self.format_name: if self.format_name:
# Close the collector and restore the # Close the collector and restore the
......
<?xml version="1.0" encoding="UTF-8"?>
<Update>
<Site>{{ hostname }}</Site>
<BuildName>{{ install_command }}</BuildName>
<BuildStamp>{{ buildstamp }}</BuildStamp>
<StartTime>{{ starttime }}</StartTime>
<EndTime>{{ endtime }}</EndTime>
{% if msg %}
<UpdateReturnStatus>{{ msg }}</UpdateReturnStatus>
{% endif %}
</Update>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment