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

update test_record_script tests

parent 82ceed4e
Branches
No related tags found
1 merge request!115Resolve "declutter the top level log file"
......@@ -177,16 +177,15 @@ def test_record_script_execution_summary(tmp_path):
cmd_log_file = mod.config_vars["cmd_log_file"]
root_dir = tmp_path / "test_prepare_env"
mpsd_release_to_test = "dev-23a"
script_version = mod.__version__
if os.path.exists(root_dir / cmd_log_file):
initial_bytes = os.path.getsize(cmd_log_file)
else:
initial_bytes = 0
# run the prepare_env functionality
# run the init functionality to check the creation of log file
create_mock_git_repository(target_directory=root_dir, create_directory=True)
mod.prepare_environment(mpsd_release=mpsd_release_to_test, root_dir=(root_dir))
mod.initialise_environment(root_dir=(root_dir))
# check that logs/install-software-environment.log is updated
assert os.path.exists(root_dir / cmd_log_file)
......@@ -195,8 +194,8 @@ def test_record_script_execution_summary(tmp_path):
# Check that the log file has "Spack environments branch: dev-23a " in the last line
with open(root_dir / cmd_log_file, "r") as f:
lines = f.readlines()
assert "Spack environments branch: releases/dev-23a " in lines[-1]
assert f"MPSD Software manager version: {script_version}" in lines[-2]
assert f"Initialising MPSD software instance at {tmp_path}" in lines[-2]
assert f"MPSD Software manager version: {script_version}" in lines[-1]
def test_install_environment_wrong_package_set(tmp_path):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment