Skip to content
Snippets Groups Projects
Commit 631e2eea authored by Ashwin Kumar Karnad's avatar Ashwin Kumar Karnad
Browse files

Handle and test wrong mpsd_release

parent 38700575
No related branches found
No related tags found
2 merge requests!19Move linux-debian11 into main,!1Resolve "First draft for user interface for top level install command"
......@@ -92,7 +92,9 @@ def create_dir_structure(mpsd_release, script_dir):
with os_chdir("spack-environments"):
# Git fetch and checkout the release branch and git pull to be sure that the resulting repo is up to date
subprocess.run(["git", "fetch", "--all"])
subprocess.run(["git", "checkout", mpsd_release])
checkout_result = subprocess.run(["git", "checkout", mpsd_release])
if checkout_result.returncode != 0:
raise Exception("Release branch does not exist in spack-environment repo \n. Check for typos.")
subprocess.run(["git", "pull"])
......
......@@ -83,10 +83,18 @@ def test_setup_log_cmd(tmp_path):
def test_install_environment(tmp_path):
# Expect and Exception when wrong toolchains are provided
# Expect an Exception when wrong toolchains are provided
with pytest.raises(Exception):
mod.install_environment(
mpsd_release="dev-23a",
toolchains=["wrong-toolchain"],
script_dir=(tmp_path),
)
\ No newline at end of file
)
# Expect an Exception when wrong mpsd_release is provided
with pytest.raises(Exception):
mod.install_environment(
mpsd_release="wrong-mpsd-release",
toolchains=["foss2021a-mpi"],
script_dir=(tmp_path),
)
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment