diff options
author | Peter Scheibel <scheibel1@llnl.gov> | 2015-10-15 12:23:56 -0700 |
---|---|---|
committer | Peter Scheibel <scheibel1@llnl.gov> | 2015-10-15 12:23:56 -0700 |
commit | c985ad7644e00fa2fd5253d6b3f761a2596c6c4b (patch) | |
tree | 60a57c83d4523ac9826e6ed388058626ab2c6789 /lib | |
parent | b9bf0b942c4e2770de65282311876d02d00e7f5b (diff) | |
download | spack-c985ad7644e00fa2fd5253d6b3f761a2596c6c4b.tar.gz spack-c985ad7644e00fa2fd5253d6b3f761a2596c6c4b.tar.bz2 spack-c985ad7644e00fa2fd5253d6b3f761a2596c6c4b.tar.xz spack-c985ad7644e00fa2fd5253d6b3f761a2596c6c4b.zip |
Update test failure output: don't include the entire build log, just lines which
mention errors (or if no such lines can be found, output the last 10 lines from
the log).
Diffstat (limited to 'lib')
-rw-r--r-- | lib/spack/spack/cmd/test-install.py | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/lib/spack/spack/cmd/test-install.py b/lib/spack/spack/cmd/test-install.py index 6652a204fb..f2c40e57e4 100644 --- a/lib/spack/spack/cmd/test-install.py +++ b/lib/spack/spack/cmd/test-install.py @@ -25,6 +25,7 @@ from external import argparse import xml.etree.ElementTree as ET import itertools +import re import llnl.util.tty as tty from llnl.util.filesystem import * @@ -104,11 +105,15 @@ def create_test_output(topSpec, newInstalls, output): buildLogPath = join_path(package.stage.source_path, 'spack-build.out') with open(buildLogPath, 'rb') as F: - buildLog = F.read() #TODO: this may not return all output - #TODO: add the whole build log? it could be several thousand - # lines. It may be better to look for errors. - output.add_test(bId, package.installed, buildLogPath + '\n' + - spec.to_yaml() + buildLog) + lines = F.readlines() + errMessages = list(line for line in lines if + re.search('error:', line, re.IGNORECASE)) + errOutput = errMessages if errMessages else lines[-10:] + errOutput = '\n'.join(itertools.chain( + [spec.to_yaml(), "Errors:"], errOutput, + ["Build Log:", buildLogPath])) + + output.add_test(bId, package.installed, errOutput) def test_install(parser, args): |