Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • hmenke/mpsd-software-manager
  • mpsd-cs/mpsd-software-manager
2 results
Show changes
Commits on Source (4)
......@@ -193,6 +193,7 @@ def setup_log_cmd(
run(
["git", "rev-parse", "--abbrev-ref", "HEAD"],
stdout=subprocess.PIPE,
check=True,
)
.stdout.decode()
.strip()
......@@ -201,6 +202,7 @@ def setup_log_cmd(
run(
["git", "rev-parse", "--short", "HEAD"],
stdout=subprocess.PIPE,
check=True,
)
.stdout.decode()
.strip()
......@@ -250,7 +252,8 @@ def create_dir_structure(mpsd_release: str, script_dir: Path) -> None:
"git",
"clone",
config_vars["spack_environments_repo"],
]
],
check=True,
)
with os_chdir("spack-environments"):
# Git fetch and checkout the release branch and git pull
......@@ -460,6 +463,7 @@ def install_environment(
f"bash {spack_setup_script} {' '.join(install_flags)} {toolchain} 2>&1 "
f"| tee -a {install_log_file} ",
shell=True,
check=True,
)
......
......@@ -43,11 +43,29 @@ def test_prepare_environment(tmp_path):
# check that the test directory does not exist
assert not script_dir.exists()
# prepare_environment expects to be executed in git repository
# (mpsd-software-environments). It queries the commit on which we are to
# log that information. For this to work, we need to execute the command
# within a directory tree that has a git repository at the same or high
# level. Let's create one:
# create directory first
script_dir.mkdir(parents=True)
# then create git repository:
with mod.os_chdir(str(script_dir)):
subprocess.run("git init .", shell=True, check=True)
subprocess.run("echo 'fake content' > readme.txt", shell=True, check=True)
subprocess.run("git add readme.txt", shell=True, check=True)
subprocess.run("pwd", shell=True)
subprocess.run(
'git commit -m "first commit" readme.txt', shell=True, check=True
)
# now call the function we want to test
result = mod.prepare_environment(
mpsd_release=mpsd_release_to_test, script_dir=(script_dir)
mpsd_release=mpsd_release_to_test, script_dir=script_dir
)
# wait for 20 seconds for the git clone to finish
# time.sleep(20)
# check if the directory now is created
assert release_base_dir.exists()
# check for spack-environments directory
......