Resolved eleven unit test failures (#18979)
This commit is contained in:
committed by
Tamara Dahlgren
parent
c6cd52f616
commit
9afff8eb60
@@ -26,7 +26,7 @@
|
||||
class AllClean(argparse.Action):
|
||||
"""Activates flags -s -d -f -m and -p simultaneously"""
|
||||
def __call__(self, parser, namespace, values, option_string=None):
|
||||
parser.parse_args(['-sdfmpt'], namespace=namespace)
|
||||
parser.parse_args(['-sdfmp'], namespace=namespace)
|
||||
|
||||
|
||||
def setup_parser(subparser):
|
||||
|
||||
@@ -230,7 +230,7 @@ def match(t, f):
|
||||
|
||||
|
||||
def test_status(args):
|
||||
"""Get the current status for a particular Spack test suites."""
|
||||
"""Get the current status for the specified Spack test suite(s)."""
|
||||
if args.names:
|
||||
test_suites = []
|
||||
for name in args.names:
|
||||
@@ -251,7 +251,7 @@ def test_status(args):
|
||||
|
||||
|
||||
def test_results(args):
|
||||
"""Get the results from Spack test suites (default all)."""
|
||||
"""Get the results from Spack test suite(s) (default all)."""
|
||||
if args.names:
|
||||
test_suites = []
|
||||
for name in args.names:
|
||||
@@ -284,9 +284,9 @@ def test_results(args):
|
||||
|
||||
|
||||
def test_remove(args):
|
||||
"""Remove results for a test from the test stage.
|
||||
"""Remove results from Spack test suite(s) (default all).
|
||||
|
||||
If no test is listed, remove all tests from the test stage.
|
||||
If no test suite is listed, remove results for all suites.
|
||||
|
||||
Removed tests can no longer be accessed for results or status, and will not
|
||||
appear in `spack test list` results."""
|
||||
|
||||
@@ -39,7 +39,7 @@ def __call__(self, *args, **kwargs):
|
||||
yield counts
|
||||
|
||||
|
||||
all_effects = ['stages', 'downloads', 'caches', 'failures', 'tests']
|
||||
all_effects = ['stages', 'downloads', 'caches', 'failures']
|
||||
|
||||
|
||||
@pytest.mark.usefixtures(
|
||||
|
||||
@@ -44,15 +44,17 @@ def test_test_output(mock_test_stage, mock_packages, mock_archive, mock_fetch,
|
||||
install('printing-package')
|
||||
spack_test('run', 'printing-package')
|
||||
|
||||
contents = os.listdir(mock_test_stage)
|
||||
assert len(contents) == 1
|
||||
stage_files = os.listdir(mock_test_stage)
|
||||
assert len(stage_files) == 1
|
||||
|
||||
testdir = os.path.join(mock_test_stage, contents[0])
|
||||
contents = os.listdir(testdir)
|
||||
assert len(contents) == 4
|
||||
# Grab test stage directory contents
|
||||
testdir = os.path.join(mock_test_stage, stage_files[0])
|
||||
testdir_files = os.listdir(testdir)
|
||||
|
||||
contents = list(filter(lambda x: x != 'results.txt', contents))
|
||||
outfile = os.path.join(testdir, contents[0])
|
||||
# Grab the output from the test log
|
||||
testlog = list(filter(lambda x: x.endswith('out.txt') and
|
||||
x != 'results.txt', testdir_files))
|
||||
outfile = os.path.join(testdir, testlog[0])
|
||||
with open(outfile, 'r') as f:
|
||||
output = f.read()
|
||||
assert "BEFORE TEST" in output
|
||||
@@ -71,7 +73,7 @@ def test_test_output_on_error(
|
||||
out = spack_test('run', 'test-error', fail_on_error=False)
|
||||
|
||||
assert "TestFailure" in out
|
||||
assert "FAILED: Command exited with status 1" in out
|
||||
assert "Command exited with status 1" in out
|
||||
|
||||
|
||||
def test_test_output_on_failure(
|
||||
|
||||
@@ -17,9 +17,7 @@ def test_test_log_pathname(mock_packages, config):
|
||||
logfile = test_suite.log_file_for_spec(spec)
|
||||
|
||||
assert test_suite.stage in logfile
|
||||
assert test_name in logfile
|
||||
assert spec.name in logfile
|
||||
assert 'out.txt' in logfile
|
||||
assert test_suite.test_log_name(spec) in logfile
|
||||
|
||||
|
||||
def test_test_ensure_stage(mock_test_stage):
|
||||
@@ -31,8 +29,7 @@ def test_test_ensure_stage(mock_test_stage):
|
||||
test_suite = spack.install_test.TestSuite([spec], test_name)
|
||||
test_suite.ensure_stage()
|
||||
|
||||
assert os.path.exists(test_suite.stage)
|
||||
assert test_suite.stage.endswith(test_name)
|
||||
assert os.path.isdir(test_suite.stage)
|
||||
assert mock_test_stage in test_suite.stage
|
||||
|
||||
|
||||
|
||||
@@ -475,7 +475,7 @@ _spack_ci_rebuild() {
|
||||
_spack_clean() {
|
||||
if $list_options
|
||||
then
|
||||
SPACK_COMPREPLY="-h --help -s --stage -d --downloads -f --failures -m --misc-cache -p --python-cache -t --test-stage -a --all"
|
||||
SPACK_COMPREPLY="-h --help -s --stage -d --downloads -f --failures -m --misc-cache -p --python-cache -a --all"
|
||||
else
|
||||
_all_packages
|
||||
fi
|
||||
@@ -1002,7 +1002,7 @@ _spack_info() {
|
||||
_spack_install() {
|
||||
if $list_options
|
||||
then
|
||||
SPACK_COMPREPLY="-h --help --only -u --until -j --jobs --overwrite --fail-fast --keep-prefix --keep-stage --dont-restage --use-cache --no-cache --cache-only --no-check-signature --show-log-on-error --source -n --no-checksum -v --verbose --fake --only-concrete -f --file --clean --dirty --test --run-tests --log-format --log-file --help-cdash -y --yes-to-all --cdash-upload-url --cdash-build --cdash-site --cdash-track --cdash-buildstamp"
|
||||
SPACK_COMPREPLY="-h --help --only -u --until -j --jobs --overwrite --fail-fast --keep-prefix --keep-stage --dont-restage --use-cache --no-cache --cache-only --no-check-signature --show-log-on-error --source -n --no-checksum -v --verbose --fake --only-concrete -f --file --clean --dirty --test --run-tests --log-format --log-file --help-cdash --cdash-upload-url --cdash-build --cdash-site --cdash-track --cdash-buildstamp -y --yes-to-all"
|
||||
else
|
||||
_all_packages
|
||||
fi
|
||||
@@ -1469,14 +1469,14 @@ _spack_test() {
|
||||
then
|
||||
SPACK_COMPREPLY="-h --help"
|
||||
else
|
||||
SPACK_COMPREPLY="run list status results remove"
|
||||
SPACK_COMPREPLY="run list find status results remove"
|
||||
fi
|
||||
}
|
||||
|
||||
_spack_test_run() {
|
||||
if $list_options
|
||||
then
|
||||
SPACK_COMPREPLY="-h --help -n --name --fail-fast --fail-first --keep-stage --log-format --log-file --cdash-upload-url --cdash-build --cdash-site --cdash-track --cdash-buildstamp --help-cdash --smoke --capability --clean --dirty"
|
||||
SPACK_COMPREPLY="-h --help --alias --fail-fast --fail-first --keep-stage --log-format --log-file --cdash-upload-url --cdash-build --cdash-site --cdash-track --cdash-buildstamp --help-cdash --smoke --capability --clean --dirty"
|
||||
else
|
||||
_installed_packages
|
||||
fi
|
||||
@@ -1491,6 +1491,15 @@ _spack_test_list() {
|
||||
fi
|
||||
}
|
||||
|
||||
_spack_test_find() {
|
||||
if $list_options
|
||||
then
|
||||
SPACK_COMPREPLY="-h --help"
|
||||
else
|
||||
_all_packages
|
||||
fi
|
||||
}
|
||||
|
||||
_spack_test_status() {
|
||||
if $list_options
|
||||
then
|
||||
@@ -1512,7 +1521,7 @@ _spack_test_results() {
|
||||
_spack_test_remove() {
|
||||
if $list_options
|
||||
then
|
||||
SPACK_COMPREPLY="-h --help"
|
||||
SPACK_COMPREPLY="-h --help -y --yes-to-all"
|
||||
else
|
||||
SPACK_COMPREPLY=""
|
||||
fi
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
#
|
||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||
|
||||
import llnl.util.tty as tty
|
||||
import re
|
||||
|
||||
|
||||
@@ -267,11 +266,4 @@ def _test_check_versions(self):
|
||||
|
||||
def test(self):
|
||||
"""Perform smoke tests on the installed package."""
|
||||
tty.debug('Expected results currently based on simple cmake builds')
|
||||
|
||||
if not self.spec.satisfies('@3.8.2:3.17.3'):
|
||||
tty.debug('Expected results have not been confirmed for {0} {1}'
|
||||
.format(self.name, self.spec.version))
|
||||
|
||||
# Simple version check tests on known binaries
|
||||
self._test_check_versions()
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
#
|
||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||
|
||||
import llnl.util.tty as tty
|
||||
|
||||
from spack import *
|
||||
|
||||
import sys
|
||||
@@ -95,11 +93,5 @@ def _test_check_versions(self):
|
||||
|
||||
def test(self):
|
||||
"""Perform smoke tests on the installed package."""
|
||||
tty.debug('Expected results currently based on simple cmake builds')
|
||||
|
||||
if not self.spec.satisfies('@24.5:26.3'):
|
||||
tty.debug('Expected results have not been confirmed for {0} {1}'
|
||||
.format(self.name, self.spec.version))
|
||||
|
||||
# Simple version check tests on known binaries
|
||||
self._test_check_versions()
|
||||
|
||||
@@ -214,5 +214,5 @@ def test(self):
|
||||
# Run gif converter sequence test
|
||||
self._test_gif_converters()
|
||||
|
||||
# Run gif converter sequence test
|
||||
# Run hdfls output
|
||||
self._test_list()
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
#
|
||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||
|
||||
import llnl.util.tty as tty
|
||||
|
||||
|
||||
class Libsigsegv(AutotoolsPackage, GNUMirrorPackage):
|
||||
"""GNU libsigsegv is a library for handling page faults in user mode."""
|
||||
@@ -70,14 +68,6 @@ def _run_build_tests(self):
|
||||
skip_missing=True)
|
||||
|
||||
def test(self):
|
||||
"""Perform smoke tests on the installed package."""
|
||||
tty.debug('Expected results currently based on simple {0} builds'
|
||||
.format(self.name))
|
||||
|
||||
if not self.spec.satisfies('@2.10:2.12'):
|
||||
tty.debug('Expected results have not been confirmed for {0} {1}'
|
||||
.format(self.name, self.spec.version))
|
||||
|
||||
# Run the simple built-in smoke test
|
||||
self._run_smoke_tests()
|
||||
|
||||
|
||||
@@ -277,14 +277,6 @@ def _run_tut_checks(self):
|
||||
|
||||
def test(self):
|
||||
"""Perform smoke tests on the installed package."""
|
||||
tty.debug('Expected results currently based on simple {0} builds'
|
||||
.format(self.name))
|
||||
|
||||
if not self.spec.satisfies('@0.1.3:2.1.0'):
|
||||
tty.debug('Expected results have not been confirmed for {0} {1}'
|
||||
.format(self.name, self.spec.version))
|
||||
|
||||
# Run smoke tests
|
||||
self._run_bench_checks()
|
||||
self._run_cookbook_checks()
|
||||
self._run_example_checks()
|
||||
|
||||
Reference in New Issue
Block a user