Skip to content

Commit

Permalink
Fix tests that refer to software direcories
Browse files Browse the repository at this point in the history
  • Loading branch information
douglasjacobsen committed Oct 18, 2024
1 parent a4c85ba commit a6bc0c2
Show file tree
Hide file tree
Showing 17 changed files with 24 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def test_dryrun_copies_external_env(mutable_config, mutable_mock_workspace_path,
setup_pipeline = setup_cls(ws, filters)
setup_pipeline.run()

env_file = os.path.join(ws.software_dir, "wrfv4", "spack.yaml")
env_file = os.path.join(ws.software_dir, "spack", "wrfv4", "spack.yaml")

assert os.path.exists(env_file)

Expand Down
2 changes: 1 addition & 1 deletion lib/ramble/ramble/test/end_to_end/experiment_excludes.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ def test_wrfv4_exclusions(mutable_config, mutable_mock_workspace_path):
software_base_dir = os.path.join(ws1.root, ramble.workspace.workspace_software_path)
assert os.path.exists(software_base_dir)
for software_dir in software_dirs:
software_path = os.path.join(software_base_dir, software_dir)
software_path = os.path.join(software_base_dir, "spack", software_dir)
assert os.path.exists(software_path)

spack_file = os.path.join(software_path, "spack.yaml")
Expand Down
2 changes: 1 addition & 1 deletion lib/ramble/ramble/test/end_to_end/experiment_hashes.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def test_experiment_hashes(mutable_config, mutable_mock_workspace_path, request)
assert len(expected_templates) == 0

# Test software environments
expected_envs = {"software/gromacs"}
expected_envs = {"software/spack/gromacs"}
assert "software" in data
for env in data["software"]:
if env["name"] in expected_envs:
Expand Down
4 changes: 2 additions & 2 deletions lib/ramble/ramble/test/end_to_end/experiment_repeats.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,10 @@ def test_gromacs_repeats(mutable_config, mutable_mock_workspace_path):

# Test software directories
software_dirs = ["gromacs"]
software_base_dir = os.path.join(ws1.root, ramble.workspace.workspace_software_path)
software_base_dir = ws1.software_dir
assert os.path.exists(software_base_dir)
for software_dir in software_dirs:
software_path = os.path.join(software_base_dir, software_dir)
software_path = os.path.join(software_base_dir, "spack", software_dir)
assert os.path.exists(software_path)

spack_file = os.path.join(software_path, "spack.yaml")
Expand Down
4 changes: 2 additions & 2 deletions lib/ramble/ramble/test/end_to_end/explicit_zips.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,10 @@ def test_wrfv4_explicit_zips(mutable_config, mutable_mock_workspace_path):

# Test software directories
software_dirs = ["wrfv4", "wrfv4-portable"]
software_base_dir = os.path.join(ws1.root, ramble.workspace.workspace_software_path)
software_base_dir = ws1.software_dir
assert os.path.exists(software_base_dir)
for software_dir in software_dirs:
software_path = os.path.join(software_base_dir, software_dir)
software_path = os.path.join(software_base_dir, "spack", software_dir)
assert os.path.exists(software_path)

spack_file = os.path.join(software_path, "spack.yaml")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,10 @@ def test_included_configuration_files(mutable_config, mutable_mock_workspace_pat

# Test software directories
software_dirs = ["wrfv4", "wrfv4-portable"]
software_base_dir = os.path.join(ws1.root, ramble.workspace.workspace_software_path)
software_base_dir = ws1.software_dir
assert os.path.exists(software_base_dir)
for software_dir in software_dirs:
software_path = os.path.join(software_base_dir, software_dir)
software_path = os.path.join(software_base_dir, "spack", software_dir)
assert os.path.exists(software_path)

spack_file = os.path.join(software_path, "spack.yaml")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def test_package_manager_config_zlib(mock_applications):

workspace("setup", "--dry-run", global_args=["-w", workspace_name])

spack_yaml = os.path.join(ws.software_dir, "zlib-configs", "spack.yaml")
spack_yaml = os.path.join(ws.software_dir, "spack", "zlib-configs", "spack.yaml")

assert os.path.isfile(spack_yaml)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def test_package_manager_requirements_zlib(mock_applications, mock_modifiers):

workspace("setup", global_args=["-w", workspace_name])

spack_yaml = os.path.join(ws.software_dir, "zlib-configs", "spack.yaml")
spack_yaml = os.path.join(ws.software_dir, "spack", "zlib-configs", "spack.yaml")

assert os.path.isfile(spack_yaml)

Expand Down
6 changes: 3 additions & 3 deletions lib/ramble/ramble/test/end_to_end/spack_env_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ def test_spack_env_cache():
)

# spack env should be present only at the env_name level.
assert os.path.exists(os.path.join(ws.software_dir, "gromacs"))
assert os.path.exists(os.path.join(ws.software_dir, "g2"))
assert not os.path.exists(os.path.join(ws.software_dir, "g2.water_bare"))
assert os.path.exists(os.path.join(ws.software_dir, "spack", "gromacs"))
assert os.path.exists(os.path.join(ws.software_dir, "spack", "g2"))
assert not os.path.exists(os.path.join(ws.software_dir, "spack", "g2.water_bare"))

# First encounter of an env_name (test1 -> gromacs, test2 -> g2) requires spack usage.
test1_log = os.path.join(ws.log_dir, "setup.latest", "gromacs.water_bare.test1.out")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def test_configvar_dry_run(mutable_config, mutable_mock_workspace_path):
software_base_dir = os.path.join(ws.root, ramble.workspace.workspace_software_path)
assert os.path.exists(software_base_dir)

software_path = os.path.join(software_base_dir, software_dir)
software_path = os.path.join(software_base_dir, "spack", software_dir)
assert os.path.exists(software_path)

for i, exp in enumerate(expected_experiments):
Expand Down
4 changes: 2 additions & 2 deletions lib/ramble/ramble/test/end_to_end/wrfv4_dry_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,10 @@ def test_wrfv4_spack_dry_run(mutable_config, mutable_mock_workspace_path):

# Test software directories
software_dirs = ["wrfv4", "wrfv4-portable"]
software_base_dir = os.path.join(ws1.root, ramble.workspace.workspace_software_path)
software_base_dir = ws1.software_dir
assert os.path.exists(software_base_dir)
for software_dir in software_dirs:
software_path = os.path.join(software_base_dir, software_dir)
software_path = os.path.join(software_base_dir, "spack", software_dir)
assert os.path.exists(software_path)

spack_file = os.path.join(software_path, "spack.yaml")
Expand Down
2 changes: 1 addition & 1 deletion lib/ramble/ramble/test/modifier_application.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def test_wrfv4_aps_test(mutable_config, mutable_mock_workspace_path):

workspace("setup", "--dry-run", global_args=["-w", workspace_name])

software_path = os.path.join(ws1.software_dir, "wrfv4", "spack.yaml")
software_path = os.path.join(ws1.software_dir, "spack", "wrfv4", "spack.yaml")
with open(software_path) as f:
assert "intel-oneapi-vtune" in f.read()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def test_gromacs_dry_run_mock_env_vars_mod(
workspace("setup", "--dry-run", global_args=["-D", ws1.root])

# Test software directories
software_base_dir = ws1.software_dir
software_base_dir = os.path.join(ws1.software_dir, "spack")

modifier_helpers.check_software_env(software_base_dir, software_tests)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def test_gromacs_mock_spack_config_mod(

assert os.path.isfile(exp_script)

spack_yaml = os.path.join(ws1.software_dir, "gromacs", "spack.yaml")
spack_yaml = os.path.join(ws1.software_dir, "spack", "gromacs", "spack.yaml")
assert os.path.isfile(spack_yaml)

with open(spack_yaml) as f:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,6 @@ def test_gromacs_dry_run_mock_spack_mod(
assert search_files_for_string(out_files, expected_str)

# Test software directories
software_base_dir = ws1.software_dir
software_base_dir = os.path.join(ws1.software_dir, "spack")

modifier_helpers.check_software_env(software_base_dir, software_tests)
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def test_gromacs_multi_modifier_dry_run(
workspace("setup", "--dry-run", global_args=["-D", ws1.root])

# Test software directories
software_base_dir = ws1.software_dir
software_base_dir = os.path.join(ws1.software_dir, "spack")

modifier_helpers.check_software_env(software_base_dir, software_tests)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def test_gromacs_single_full_modifier_dry_run(
workspace("setup", "--dry-run", global_args=["-D", ws1.root])

# Test software directories
software_base_dir = ws1.software_dir
software_base_dir = os.path.join(ws1.software_dir, "spack")

modifier_helpers.check_software_env(software_base_dir, software_tests)

Expand Down Expand Up @@ -109,7 +109,7 @@ def test_gromacs_single_stub_modifier_dry_run(
workspace("setup", "--dry-run", global_args=["-D", ws1.root])

# Test software directories
software_base_dir = ws1.software_dir
software_base_dir = os.path.join(ws1.software_dir, "spack")

modifier_helpers.check_software_env(software_base_dir, software_tests)

Expand Down

0 comments on commit a6bc0c2

Please sign in to comment.