match arg names

This commit is contained in:
Daniel 2023-12-07 22:13:32 +01:00
parent 349bf9f053
commit b7a8ed1f86
3 changed files with 7 additions and 7 deletions

View file

@ -18,7 +18,7 @@ def run():
parser.add_argument("--debug", action="store_true", help="Enable Playwright debug mode") parser.add_argument("--debug", action="store_true", help="Enable Playwright debug mode")
parser.add_argument("--resume", action="store_true", help="Re-run the most recent test, skipping passed tests") parser.add_argument("--resume", action="store_true", help="Re-run the most recent test, skipping passed tests")
args = parser.parse_args() args = parser.parse_args()
ENV_FILES = [Path(s) for s in args.env_paths.split(";")] env_paths = [Path(s) for s in args.env_paths.split(";")]
# -------------------------- enable playwright debug ------------------------- # # -------------------------- enable playwright debug ------------------------- #
@ -43,7 +43,7 @@ def run():
# ---------------------------- initialize and run ---------------------------- # # ---------------------------- initialize and run ---------------------------- #
coordinator = Coordinator( coordinator = Coordinator(
env_paths_list=ENV_FILES, env_paths=env_paths,
output_dir=args.output_dir, output_dir=args.output_dir,
session_id=session_id, session_id=session_id,
recipes_dir=args.recipes_dir, recipes_dir=args.recipes_dir,

View file

@ -15,21 +15,21 @@ from pytest_abra.utils import rmtree
class Coordinator: class Coordinator:
def __init__( def __init__(
self, self,
env_paths_list: list[Path], env_paths: list[Path],
output_dir: Path, output_dir: Path,
session_id: str, session_id: str,
recipes_dir: Path, recipes_dir: Path,
timeout: int, timeout: int,
) -> None: ) -> None:
# logging # logging
out_string = "".join([e.name + "\n" for e in env_paths_list]) out_string = "".join([e.name + "\n" for e in env_paths])
out_string += f"output_dir = {output_dir}\n" out_string += f"output_dir = {output_dir}\n"
out_string += f"session_id = {session_id}" out_string += f"session_id = {session_id}"
logger.info(f"initialize Coordinator instance with\nenv_paths_list =\n{out_string}") logger.info(f"initialize Coordinator instance with\nenv_paths_list =\n{out_string}")
self.RUNNER_DICT = self.create_runner_dict(recipes_dir) self.RUNNER_DICT = self.create_runner_dict(recipes_dir)
self.DIR = DirManager(output_dir=output_dir, session_id=session_id, recipes_dir=recipes_dir) self.DIR = DirManager(output_dir=output_dir, session_id=session_id, recipes_dir=recipes_dir)
self.ENV = EnvManager(env_paths_list, self.RUNNER_DICT) self.ENV = EnvManager(env_paths=env_paths, RUNNER_DICT=self.RUNNER_DICT)
self.TIMEOUT = timeout self.TIMEOUT = timeout
def setup_test(self) -> None: def setup_test(self) -> None:

View file

@ -23,8 +23,8 @@ class DependencyRule(NamedTuple):
class EnvManager: class EnvManager:
def __init__(self, env_paths_list: list[Path], RUNNER_DICT: dict[str, type["Runner"]]): def __init__(self, env_paths: list[Path], RUNNER_DICT: dict[str, type["Runner"]]):
self.env_files: list[EnvFile] = self._get_env_files(env_paths_list) self.env_files: list[EnvFile] = self._get_env_files(env_paths)
self.dependency_rules: list[DependencyRule] = self._get_dependency_rules(self.env_files, RUNNER_DICT) self.dependency_rules: list[DependencyRule] = self._get_dependency_rules(self.env_files, RUNNER_DICT)
self.env_files = self.sort_env_files_by_rule(self.env_files, self.dependency_rules) self.env_files = self.sort_env_files_by_rule(self.env_files, self.dependency_rules)