test_load_json_specfiles: skip virtual reconstruction (#50361)

This commit is contained in:
Tamara Dahlgren 2025-05-14 01:32:47 -07:00 committed by GitHub
parent abcc641373
commit 719fd6fb43
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -420,13 +420,15 @@ def test_load_json_specfiles(specfile, expected_hash, reader_cls):
openmpi_edges = s2.edges_to_dependencies(name="openmpi")
assert len(openmpi_edges) == 1
# Check that virtuals have been reconstructed
assert "mpi" in openmpi_edges[0].virtuals
# Check that virtuals have been reconstructed for specfiles conforming to
# version 4 on.
if reader_cls.SPEC_VERSION >= spack.spec.SpecfileV4.SPEC_VERSION:
assert "mpi" in openmpi_edges[0].virtuals
# The virtuals attribute must be a tuple, when read from a
# JSON or YAML file, not a list
for edge in s2.traverse_edges():
assert isinstance(edge.virtuals, tuple), edge
# The virtuals attribute must be a tuple, when read from a
# JSON or YAML file, not a list
for edge in s2.traverse_edges():
assert isinstance(edge.virtuals, tuple), edge
# Ensure we can format {compiler} tokens
assert s2.format("{compiler}") != "none"