diff --git a/lib/spack/spack/cmd/clean.py b/lib/spack/spack/cmd/clean.py index e4cacf41a44..f69b9592931 100644 --- a/lib/spack/spack/cmd/clean.py +++ b/lib/spack/spack/cmd/clean.py @@ -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): diff --git a/lib/spack/spack/cmd/test.py b/lib/spack/spack/cmd/test.py index 4cb260698f6..eecefd904b5 100644 --- a/lib/spack/spack/cmd/test.py +++ b/lib/spack/spack/cmd/test.py @@ -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.""" diff --git a/lib/spack/spack/test/cmd/clean.py b/lib/spack/spack/test/cmd/clean.py index c0668487e27..dcaf0c916cc 100644 --- a/lib/spack/spack/test/cmd/clean.py +++ b/lib/spack/spack/test/cmd/clean.py @@ -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( diff --git a/lib/spack/spack/test/cmd/test.py b/lib/spack/spack/test/cmd/test.py index 4967fc6b2ee..4163853274b 100644 --- a/lib/spack/spack/test/cmd/test.py +++ b/lib/spack/spack/test/cmd/test.py @@ -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( diff --git a/lib/spack/spack/test/test_suite.py b/lib/spack/spack/test/test_suite.py index 737ae18a685..1ec51061820 100644 --- a/lib/spack/spack/test/test_suite.py +++ b/lib/spack/spack/test/test_suite.py @@ -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 diff --git a/share/spack/spack-completion.bash b/share/spack/spack-completion.bash index bc2ad52387f..e0d2d55a23e 100755 --- a/share/spack/spack-completion.bash +++ b/share/spack/spack-completion.bash @@ -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 diff --git a/var/spack/repos/builtin/packages/cmake/package.py b/var/spack/repos/builtin/packages/cmake/package.py index c6b5791e85e..1ab95e42e2e 100644 --- a/var/spack/repos/builtin/packages/cmake/package.py +++ b/var/spack/repos/builtin/packages/cmake/package.py @@ -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() diff --git a/var/spack/repos/builtin/packages/emacs/package.py b/var/spack/repos/builtin/packages/emacs/package.py index 09e0aff59fd..0759fd28d52 100644 --- a/var/spack/repos/builtin/packages/emacs/package.py +++ b/var/spack/repos/builtin/packages/emacs/package.py @@ -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() diff --git a/var/spack/repos/builtin/packages/hdf/package.py b/var/spack/repos/builtin/packages/hdf/package.py index 5c7eb7d3aae..76c2205f27d 100644 --- a/var/spack/repos/builtin/packages/hdf/package.py +++ b/var/spack/repos/builtin/packages/hdf/package.py @@ -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() diff --git a/var/spack/repos/builtin/packages/libsigsegv/package.py b/var/spack/repos/builtin/packages/libsigsegv/package.py index fc329c8a40a..119778f0183 100644 --- a/var/spack/repos/builtin/packages/libsigsegv/package.py +++ b/var/spack/repos/builtin/packages/libsigsegv/package.py @@ -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() diff --git a/var/spack/repos/builtin/packages/umpire/package.py b/var/spack/repos/builtin/packages/umpire/package.py index 9ce951cfae4..00a5738a254 100644 --- a/var/spack/repos/builtin/packages/umpire/package.py +++ b/var/spack/repos/builtin/packages/umpire/package.py @@ -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()