Remove unused values (#48795)
Signed-off-by: Todd Gamblin <tgamblin@llnl.gov> Co-authored-by: Todd Gamblin <tgamblin@llnl.gov>
This commit is contained in:
@@ -177,16 +177,15 @@ def test_run(args):
|
||||
matching = spack.store.STORE.db.query_local(spec, hashes=hashes, explicit=explicit)
|
||||
if spec and not matching:
|
||||
tty.warn("No {0}installed packages match spec {1}".format(explicit_str, spec))
|
||||
"""
|
||||
TODO: Need to write out a log message and/or CDASH Testing
|
||||
output that package not installed IF continue to process
|
||||
these issues here.
|
||||
|
||||
if args.log_format:
|
||||
# Proceed with the spec assuming the test process
|
||||
# to ensure report package as skipped (e.g., for CI)
|
||||
specs_to_test.append(spec)
|
||||
"""
|
||||
# TODO: Need to write out a log message and/or CDASH Testing
|
||||
# output that package not installed IF continue to process
|
||||
# these issues here.
|
||||
|
||||
# if args.log_format:
|
||||
# # Proceed with the spec assuming the test process
|
||||
# # to ensure report package as skipped (e.g., for CI)
|
||||
# specs_to_test.append(spec)
|
||||
|
||||
specs_to_test.extend(matching)
|
||||
|
||||
|
@@ -163,7 +163,7 @@ def format_help_sections(self, level):
|
||||
# lazily add all commands to the parser when needed.
|
||||
add_all_commands(self)
|
||||
|
||||
"""Print help on subcommands in neatly formatted sections."""
|
||||
# Print help on subcommands in neatly formatted sections.
|
||||
formatter = self._get_formatter()
|
||||
|
||||
# Create a list of subcommand actions. Argparse internals are nasty!
|
||||
|
@@ -66,10 +66,6 @@
|
||||
]
|
||||
FLAG_HANDLER_TYPE = Callable[[str, Iterable[str]], FLAG_HANDLER_RETURN_TYPE]
|
||||
|
||||
"""Allowed URL schemes for spack packages."""
|
||||
_ALLOWED_URL_SCHEMES = ["http", "https", "ftp", "file", "git"]
|
||||
|
||||
|
||||
#: Filename for the Spack build/install log.
|
||||
_spack_build_logfile = "spack-build-out.txt"
|
||||
|
||||
|
@@ -4726,7 +4726,10 @@ def __str__(self):
|
||||
bool_keys = []
|
||||
kv_keys = []
|
||||
for key in sorted_keys:
|
||||
bool_keys.append(key) if isinstance(self[key].value, bool) else kv_keys.append(key)
|
||||
if isinstance(self[key].value, bool):
|
||||
bool_keys.append(key)
|
||||
else:
|
||||
kv_keys.append(key)
|
||||
|
||||
# add spaces before and after key/value variants.
|
||||
string = io.StringIO()
|
||||
|
@@ -328,16 +328,14 @@ def test_get_spec_filter_list(mutable_mock_env_path, mutable_mock_repo):
|
||||
e1.add("hypre")
|
||||
e1.concretize()
|
||||
|
||||
"""
|
||||
Concretizing the above environment results in the following graphs:
|
||||
# Concretizing the above environment results in the following graphs:
|
||||
|
||||
mpileaks -> mpich (provides mpi virtual dep of mpileaks)
|
||||
-> callpath -> dyninst -> libelf
|
||||
-> libdwarf -> libelf
|
||||
-> mpich (provides mpi dep of callpath)
|
||||
# mpileaks -> mpich (provides mpi virtual dep of mpileaks)
|
||||
# -> callpath -> dyninst -> libelf
|
||||
# -> libdwarf -> libelf
|
||||
# -> mpich (provides mpi dep of callpath)
|
||||
|
||||
hypre -> openblas-with-lapack (provides lapack and blas virtual deps of hypre)
|
||||
"""
|
||||
# hypre -> openblas-with-lapack (provides lapack and blas virtual deps of hypre)
|
||||
|
||||
touched = ["libdwarf"]
|
||||
|
||||
|
@@ -139,7 +139,7 @@ def test_gc_except_specific_environments(mutable_database, mutable_mock_env_path
|
||||
def test_gc_except_nonexisting_dir_env(mutable_database, mutable_mock_env_path, tmpdir):
|
||||
output = gc("-ye", tmpdir.strpath, fail_on_error=False)
|
||||
assert "No such environment" in output
|
||||
gc.returncode == 1
|
||||
assert gc.returncode == 1
|
||||
|
||||
|
||||
@pytest.mark.db
|
||||
|
@@ -26,9 +26,9 @@ def test_manpath_trailing_colon(
|
||||
else ("--sh", "export %s=%s", ";")
|
||||
)
|
||||
|
||||
"""Test that the commands generated by load add the MANPATH prefix
|
||||
inspections. Also test that Spack correctly preserves the default/existing
|
||||
manpath search path via a trailing colon"""
|
||||
# Test that the commands generated by load add the MANPATH prefix
|
||||
# inspections. Also test that Spack correctly preserves the default/existing
|
||||
# manpath search path via a trailing colon
|
||||
install("mpileaks")
|
||||
|
||||
sh_out = load(shell, "mpileaks")
|
||||
@@ -81,7 +81,9 @@ def extract_value(output, variable):
|
||||
|
||||
# Finally, do we list them in topo order?
|
||||
for i, pkg in enumerate(pkgs):
|
||||
set(s.name for s in mpileaks_spec[pkg].traverse(direction="parents")) in set(pkgs[:i])
|
||||
assert {s.name for s in mpileaks_spec[pkg].traverse(direction="parents")}.issubset(
|
||||
pkgs[: i + 1]
|
||||
)
|
||||
|
||||
# Lastly, do we keep track that mpileaks was loaded?
|
||||
assert (
|
||||
|
@@ -1,17 +1,6 @@
|
||||
# Copyright Spack Project Developers. See COPYRIGHT file for details.
|
||||
#
|
||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||
import pathlib
|
||||
|
||||
import pytest
|
||||
|
||||
import spack.concretize
|
||||
import spack.config
|
||||
import spack.environment as ev
|
||||
import spack.paths
|
||||
import spack.repo
|
||||
import spack.spec
|
||||
import spack.util.spack_yaml as syaml
|
||||
|
||||
"""
|
||||
These tests include the following package DAGs:
|
||||
@@ -42,6 +31,18 @@
|
||||
y
|
||||
"""
|
||||
|
||||
import pathlib
|
||||
|
||||
import pytest
|
||||
|
||||
import spack.concretize
|
||||
import spack.config
|
||||
import spack.environment as ev
|
||||
import spack.paths
|
||||
import spack.repo
|
||||
import spack.spec
|
||||
import spack.util.spack_yaml as syaml
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def test_repo(mutable_config, monkeypatch, mock_stage):
|
||||
|
@@ -93,28 +93,26 @@
|
||||
pass
|
||||
|
||||
|
||||
"""This is a list of filesystem locations to test locks in. Paths are
|
||||
expanded so that %u is replaced with the current username. '~' is also
|
||||
legal and will be expanded to the user's home directory.
|
||||
|
||||
Tests are skipped for directories that don't exist, so you'll need to
|
||||
update this with the locations of NFS, Lustre, and other mounts on your
|
||||
system.
|
||||
"""
|
||||
#: This is a list of filesystem locations to test locks in. Paths are
|
||||
#: expanded so that %u is replaced with the current username. '~' is also
|
||||
#: legal and will be expanded to the user's home directory.
|
||||
#:
|
||||
#: Tests are skipped for directories that don't exist, so you'll need to
|
||||
#: update this with the locations of NFS, Lustre, and other mounts on your
|
||||
#: system.
|
||||
locations = [
|
||||
tempfile.gettempdir(),
|
||||
os.path.join("/nfs/tmp2/", getpass.getuser()),
|
||||
os.path.join("/p/lscratch*/", getpass.getuser()),
|
||||
]
|
||||
|
||||
"""This is the longest a failed multiproc test will take.
|
||||
Barriers will time out and raise an exception after this interval.
|
||||
In MPI mode, barriers don't time out (they hang). See mpi_multiproc_test.
|
||||
"""
|
||||
#: This is the longest a failed multiproc test will take.
|
||||
#: Barriers will time out and raise an exception after this interval.
|
||||
#: In MPI mode, barriers don't time out (they hang). See mpi_multiproc_test.
|
||||
barrier_timeout = 5
|
||||
|
||||
"""This is the lock timeout for expected failures.
|
||||
This may need to be higher for some filesystems."""
|
||||
#: This is the lock timeout for expected failures.
|
||||
#: This may need to be higher for some filesystems.
|
||||
lock_fail_timeout = 0.1
|
||||
|
||||
|
||||
@@ -286,9 +284,8 @@ def wait(self):
|
||||
comm.Barrier() # barrier after each MPI test.
|
||||
|
||||
|
||||
"""``multiproc_test()`` should be called by tests below.
|
||||
``multiproc_test()`` will work for either MPI runs or for local runs.
|
||||
"""
|
||||
#: ``multiproc_test()`` should be called by tests below.
|
||||
#: ``multiproc_test()`` will work for either MPI runs or for local runs.
|
||||
multiproc_test = mpi_multiproc_test if mpi else local_multiproc_test
|
||||
|
||||
|
||||
|
@@ -132,7 +132,8 @@ def test_reporters_extract_skipped(state):
|
||||
parts = spack.reporters.extract.extract_test_parts("fake", outputs)
|
||||
|
||||
assert len(parts) == 1
|
||||
parts[0]["completed"] == expected
|
||||
|
||||
assert parts[0]["completed"] == spack.reporters.extract.completed["skipped"]
|
||||
|
||||
|
||||
def test_reporters_skip_new():
|
||||
|
@@ -198,7 +198,7 @@ def script_dir(sbang_line):
|
||||
],
|
||||
)
|
||||
def test_shebang_interpreter_regex(shebang, interpreter):
|
||||
sbang.get_interpreter(shebang) == interpreter
|
||||
assert sbang.get_interpreter(shebang) == interpreter
|
||||
|
||||
|
||||
def test_shebang_handling(script_dir, sbang_line):
|
||||
|
@@ -428,31 +428,29 @@ def test_copy_through_spec_build_interface(self):
|
||||
c2 = s["mpileaks"]["mpileaks"].copy()
|
||||
assert c0 == c1 == c2 == s
|
||||
|
||||
"""
|
||||
Here is the graph with deptypes labeled (assume all packages have a 'dt'
|
||||
prefix). Arrows are marked with the deptypes ('b' for 'build', 'l' for
|
||||
'link', 'r' for 'run').
|
||||
# Here is the graph with deptypes labeled (assume all packages have a 'dt'
|
||||
# prefix). Arrows are marked with the deptypes ('b' for 'build', 'l' for
|
||||
# 'link', 'r' for 'run').
|
||||
|
||||
use -bl-> top
|
||||
# use -bl-> top
|
||||
|
||||
top -b-> build1
|
||||
top -bl-> link1
|
||||
top -r-> run1
|
||||
# top -b-> build1
|
||||
# top -bl-> link1
|
||||
# top -r-> run1
|
||||
|
||||
build1 -b-> build2
|
||||
build1 -bl-> link2
|
||||
build1 -r-> run2
|
||||
# build1 -b-> build2
|
||||
# build1 -bl-> link2
|
||||
# build1 -r-> run2
|
||||
|
||||
link1 -bl-> link3
|
||||
# link1 -bl-> link3
|
||||
|
||||
run1 -bl-> link5
|
||||
run1 -r-> run3
|
||||
# run1 -bl-> link5
|
||||
# run1 -r-> run3
|
||||
|
||||
link3 -b-> build2
|
||||
link3 -bl-> link4
|
||||
# link3 -b-> build2
|
||||
# link3 -bl-> link4
|
||||
|
||||
run3 -b-> build3
|
||||
"""
|
||||
# run3 -b-> build3
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"spec_str,deptypes,expected",
|
||||
|
@@ -125,7 +125,7 @@ def check_expand_archive(stage, stage_name, expected_file_list):
|
||||
|
||||
assert os.path.isfile(fn)
|
||||
with open(fn, encoding="utf-8") as _file:
|
||||
_file.read() == contents
|
||||
assert _file.read() == contents
|
||||
|
||||
|
||||
def check_fetch(stage, stage_name):
|
||||
|
@@ -20,12 +20,7 @@
|
||||
|
||||
datadir = os.path.join(spack_root, "lib", "spack", "spack", "test", "data", "compression")
|
||||
|
||||
ext_archive = {}
|
||||
[
|
||||
ext_archive.update({ext: ".".join(["Foo", ext])})
|
||||
for ext in llnl.url.ALLOWED_ARCHIVE_TYPES
|
||||
if "TAR" not in ext
|
||||
]
|
||||
ext_archive = {ext: f"Foo.{ext}" for ext in llnl.url.ALLOWED_ARCHIVE_TYPES if "TAR" not in ext}
|
||||
# Spack does not use Python native handling for tarballs or zip
|
||||
# Don't test tarballs or zip in native test
|
||||
native_archive_list = [
|
||||
|
Reference in New Issue
Block a user