add-resume (#12)

* add functionality to --resume flag. latest test will resume by running failed tests again

* fix nextcloud setup -> all tests passing

* fix expect timeout by moving it to its own fixture

Reviewed-on: local-it-infrastructure/e2e_tests#12
Co-authored-by: Daniel <d.brummerloh@gmail.com>
Co-committed-by: Daniel <d.brummerloh@gmail.com>
This commit is contained in:
Daniel 2023-12-07 19:38:17 +01:00 committed by dan
parent 0b4e0a0c16
commit 41a042f07d
6 changed files with 33 additions and 6 deletions

View file

@ -1,4 +1,5 @@
from pathlib import Path
from typing import Optional
from dotenv import dotenv_values
@ -76,3 +77,13 @@ class DirManager:
env_file = next(self.ENV_FILES.glob(f"*{search_string}*"))
config: dict[str, str] = dotenv_values(env_file) # type: ignore
return config
@staticmethod
def get_latest_session_id(output_dir: Path) -> Optional[str]:
"""returns the name of the newest dir inside of output_dir"""
all_dirs = [d for d in output_dir.iterdir() if d.is_dir()]
if all_dirs:
newest_dir: Path = max(all_dirs, key=lambda x: x.stat().st_ctime)
return newest_dir.name
else:
return None