This commit is contained in:
Gregory Becker
2020-06-09 09:44:55 -07:00
committed by Tamara Dahlgren
parent 3508362dde
commit f5b165a76f
5 changed files with 18 additions and 18 deletions

View File

@@ -9,14 +9,12 @@
import collections
import llnl.util.tty as tty
import llnl.util.filesystem as fs
import spack.caches
import spack.cmd.test
import spack.cmd.common.arguments as arguments
import spack.repo
import spack.stage
import spack.util.path as sup
import spack.config
from spack.paths import lib_path, var_path

View File

@@ -101,6 +101,7 @@ def setup_parser(subparser):
'name', nargs='?',
help="Test to remove from test stage")
def test_run(args):
"""Run tests for the specified installed packages
@@ -172,10 +173,12 @@ def test_run(args):
remove_directory=not args.keep_stage,
dirty=args.dirty)
with open(_get_results_file(test_name), 'a') as f:
f.write("%s PASSED\n" % spec.format("{name}-{version}-{hash:7}"))
f.write("%s PASSED\n" %
spec.format("{name}-{version}-{hash:7}"))
except BaseException:
with open(_get_results_file(test_name), 'a') as f:
f.write("%s FAILED\n" % spec.format("{name}-{version}-{hash:7}"))
f.write("%s FAILED\n" %
spec.format("{name}-{version}-{hash:7}"))
if args.fail_first:
break
else:

View File

@@ -1606,7 +1606,7 @@ def test_dir(self):
self.spec.format('{name}-{version}-{hash}'))
def cache_extra_test_sources(self, srcs):
"""Copy relative source path(s) to the corresponding install test subdir
"""Copy relative source paths to the corresponding install test subdir
This method is intended as an optional install test setup helper for
grabbing source files/directories during the installation process and
@@ -1764,8 +1764,10 @@ def run_test(self, exe, options=[], expected=[], status=None,
# stack instead of from traceback.
# The traceback is truncated here, so we can't use it to
# traverse the stack.
m = '\n'.join(spack.build_environment.get_package_context(
traceback.extract_stack()))
m = '\n'.join(
spack.build_environment.get_package_context(
traceback.extract_stack())
)
exc = e # e is deleted after this block

View File

@@ -115,8 +115,8 @@ def test_junit_output_with_failures(tmpdir, mock_test_stage, pkg_name, msgs):
install(pkg_name)
with tmpdir.as_cwd():
spack_test('run',
'--log-format=junit', '--log-file=test.xml',
pkg_name)
'--log-format=junit', '--log-file=test.xml',
pkg_name)
files = tmpdir.listdir()
filename = tmpdir.join('test.xml')
@@ -141,9 +141,9 @@ def test_cdash_output_test_error(
install('test-error')
with tmpdir.as_cwd():
spack_test('run',
'--log-format=cdash',
'--log-file=cdash_reports',
'test-error')
'--log-format=cdash',
'--log-file=cdash_reports',
'test-error')
report_dir = tmpdir.join('cdash_reports')
print(tmpdir.listdir())
assert report_dir in tmpdir.listdir()
@@ -159,9 +159,9 @@ def test_cdash_upload_clean_test(
install('printing-package')
with tmpdir.as_cwd():
spack_test('run',
'--log-file=cdash_reports',
'--log-format=cdash',
'printing-package')
'--log-file=cdash_reports',
'--log-format=cdash',
'printing-package')
report_dir = tmpdir.join('cdash_reports')
assert report_dir in tmpdir.listdir()
report_file = report_dir.join('printing-package_Test.xml')

View File

@@ -2,9 +2,6 @@
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import llnl.util.tty as tty
from spack import *