Skip to content
Snippets Groups Projects
Commit 4aef16e1 authored by Hans Fangohr's avatar Hans Fangohr
Browse files

Merge branch 'split-installation-tests' of...

Merge branch 'split-installation-tests' of gitlab.gwdg.de:mpsd-cs/mpsd-software-environments into split-installation-tests
parents 049e0c54 29d49692
No related branches found
No related tags found
3 merge requests!19Move linux-debian11 into main,!17split one test into three,!9force `subprocess.run` to check return code is 0
Pipeline #368574 passed
This commit is part of merge request !9. Comments created here will be created in the context of that merge request.
...@@ -258,14 +258,15 @@ def create_dir_structure(mpsd_release: str, script_dir: Path) -> None: ...@@ -258,14 +258,15 @@ def create_dir_structure(mpsd_release: str, script_dir: Path) -> None:
with os_chdir("spack-environments"): with os_chdir("spack-environments"):
# Git fetch and checkout the release branch and git pull # Git fetch and checkout the release branch and git pull
# to be sure that the resulting repo is up to date # to be sure that the resulting repo is up to date
run(["git", "fetch", "--all"]) run(["git", "fetch", "--all"], check=True)
checkout_result = run(["git", "checkout", mpsd_release]) checkout_result = run(["git", "checkout", mpsd_release], check=True)
if checkout_result.returncode != 0: if checkout_result.returncode != 0:
raise Exception( raise Exception(
"Release branch does not exist in spack-environment repo \n." "Release branch does not exist in spack-environment repo \n."
"Check for typos." "Check for typos."
) )
run(["git", "pull"]) run(["git", "pull"], check=True)
def get_release_info(mpsd_release: str, script_dir: Path) -> Tuple[str, str, List[str]]: def get_release_info(mpsd_release: str, script_dir: Path) -> Tuple[str, str, List[str]]:
...@@ -306,13 +307,15 @@ def get_release_info(mpsd_release: str, script_dir: Path) -> Tuple[str, str, Lis ...@@ -306,13 +307,15 @@ def get_release_info(mpsd_release: str, script_dir: Path) -> Tuple[str, str, Lis
with os_chdir("spack-environments"): with os_chdir("spack-environments"):
# Get the branch and commit hash of the spack-environments repo # Get the branch and commit hash of the spack-environments repo
spe_commit_hash = ( spe_commit_hash = (
run(["git", "rev-parse", "HEAD"], stdout=subprocess.PIPE) run(["git", "rev-parse", "HEAD"], stdout=subprocess.PIPE, check=True)
.stdout.decode() .stdout.decode()
.strip() .strip()
) )
spe_branch = ( spe_branch = (
run( run(
["git", "rev-parse", "--abbrev-ref", "HEAD"], stdout=subprocess.PIPE ["git", "rev-parse", "--abbrev-ref", "HEAD"],
stdout=subprocess.PIPE,
check=True,
) )
.stdout.decode() .stdout.decode()
.strip() .strip()
......
...@@ -65,13 +65,13 @@ def test_os_chdir(tmp_path): ...@@ -65,13 +65,13 @@ def test_os_chdir(tmp_path):
def test_prepare_environment(tmp_path): def test_prepare_environment(tmp_path):
"""Simulate running preparation of environment. """Simulate running preparation of environment.
Simulate running ./install-software-environment.py --release dev-23a \ Simulate running ./install-software-environment.py --release dev-23a \
--target-directory /tmp/test_prepare_env --target-directory /tmp/test_prepare_env
prepare_env is run when cmd is not specified, we can test cmd='prepare' prepare_env is run when cmd is not specified, we can test cmd='prepare'
and cmd=None to check both cases and cmd=None to check both cases
""" """
script_dir = tmp_path / "test_prepare_env" script_dir = tmp_path / "mpsd_opt" / "linux_debian_11"
spack_environments = "spack-environments" spack_environments = "spack-environments"
mpsd_release_to_test = "dev-23a" mpsd_release_to_test = "dev-23a"
release_base_dir = script_dir / mpsd_release_to_test release_base_dir = script_dir / mpsd_release_to_test
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment