Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/esm_tests/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
# Define default files for comparisson
compare_files = {
"comp": ["comp-"],
"run": [".run", "finished_config", "namelists"],
"run": [".run", "finished_config", "namelists", "hostfiles"],
}


Expand Down
18 changes: 18 additions & 0 deletions src/esm_tests/test_utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,24 @@ def get_rel_paths_compare_files(info, cfile, v, this_test_dir):
num = 1
subpaths.append(f"{cf_path}/{cfiles[num].split('/')[-1]}")
break
elif cfile == "hostfiles":
# Collect all hostfile_* files from the scripts folder of the first run_ directory
ctype = "scripts"
ldir = os.listdir(f"{user_info['test_dir']}/{this_test_dir}")
ldir.sort()
for f in ldir:
# Take the first run directory
if "run_" in f:
cf_path = f"{this_test_dir}/{f}/{ctype}/"
cfiles = glob.glob(f"{user_info['test_dir']}/{cf_path}/hostfile_*")
# If not found, try in the general directory
if len(cfiles) == 0:
cf_path = f"{this_test_dir}/{ctype}/"
cfiles = glob.glob(f"{user_info['test_dir']}/{cf_path}/hostfile_*")
cfiles.sort()
for hf in cfiles:
subpaths.append(f"{cf_path}/{hf.split('/')[-1]}")
break
elif cfile == "namelists":
# Get path of the finished_config
s_config_yaml, _ = get_rel_paths_compare_files(
Expand Down
2 changes: 1 addition & 1 deletion src/esm_tests/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
# Define default files for comparisson
compare_files = {
"comp": ["comp-"],
"run": [".run", "finished_config", "namelists"],
"run": [".run", "finished_config", "namelists", "hostfiles"],
}

"""
Expand Down
Loading