Skip to content

Commit

Permalink
Mock externals for Windows runs
Browse files Browse the repository at this point in the history
  • Loading branch information
johnwparent committed Apr 23, 2024
1 parent e8c36da commit cdf6a6f
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions lib/spack/spack/test/conftest.py
Expand Up @@ -763,6 +763,27 @@ def mutable_empty_config(tmpdir_factory, configuration_dir):
yield cfg


@pytest.fixture(scope="session", autouse=True)
def mock_wsdk_externals(mock_configuration_scopes):
with spack.config.use_configuration(*mock_configuration_scopes) as config:
mock_pkgs = spack.util.spack_yaml.syaml_dict()
def make_external_entry(name):
external_pkg_items = spack.util.spack_yaml.syaml_dict([
("spec", f"{name}@10.0.20348 plat=x64"),
("prefix", "C:/Program Files (x86)/Windows Kits/10")
])
external_pkg = spack.util.spack_yaml.syaml_dict()
external_pkg["externals"] = [external_pkg_items]
external_pkg["buildable"] = False
mock_pkgs[name] = external_pkg

make_external_entry("win-sdk")
make_external_entry("wgl")
pkgs_cfg = config.get("packages")
pkgs_cfg = spack.config.merge_yaml(pkgs_cfg, mock_pkgs)
config.set("packages", pkgs_cfg)


@pytest.fixture(scope="function")
def concretize_scope(mutable_config, tmpdir):
"""Adds a scope for concretization preferences"""
Expand Down

0 comments on commit cdf6a6f

Please sign in to comment.