diff --git a/abratest/coordinator.py b/abratest/coordinator.py index 318586f..82fda18 100644 --- a/abratest/coordinator.py +++ b/abratest/coordinator.py @@ -104,5 +104,5 @@ class Coordinator: assert len(runner_class_names) == 1 runner_class_name = runner_class_names[0] RunnerClass: type[Runner] = getattr(module, runner_class_name) - RUNNER_DICT[RunnerClass.name] = RunnerClass + RUNNER_DICT[RunnerClass.env_type] = RunnerClass return RUNNER_DICT diff --git a/abratest/env_manager.py b/abratest/env_manager.py index 18086e2..00d412e 100644 --- a/abratest/env_manager.py +++ b/abratest/env_manager.py @@ -46,7 +46,7 @@ class EnvManager: for env_file in env_files: child_runner_class = RUNNER_DICT[env_file.env_type] for dependency in child_runner_class.dependencies: - dependency_rule = DependencyRule(child=child_runner_class.name, dependency=dependency) + dependency_rule = DependencyRule(child=child_runner_class.env_type, dependency=dependency) dependency_rules.append(dependency_rule) return dependency_rules diff --git a/abratest/runner.py b/abratest/runner.py index adc6ba0..f69186b 100644 --- a/abratest/runner.py +++ b/abratest/runner.py @@ -18,7 +18,7 @@ class Test: class Runner: - name: str = "" + env_type: str = "" setups: list[Test] = [] tests: list[Test] = [] cleanups: list[Test] = [] @@ -54,7 +54,7 @@ class Runner: """runs the main test script and if available and sub test scripts if their running condition is met""" # check if required dependencies have passed if not self._dependencies_passed(): - logger.warning(f"skipping run_tests() of {self.name}, because some dependencies have not passed") + logger.warning(f"skipping run_tests() of {self.env_type}, because some dependencies have not passed") return for test in test_list: @@ -67,7 +67,7 @@ class Runner: # condition_available: true / pass # condition_met: true / false - identifier_string = self.combine_names(self.name, test.test_file) + identifier_string = self.combine_names(self.env_type, test.test_file) results = list(self.DIR.RECIPES.rglob(test.test_file)) assert len(results) == 1, f"{test.test_file} should exist exactly 1 time, but found {len(results)} times" @@ -177,7 +177,7 @@ class Runner: results = [] for dependency_runner in self._dependency_runners: for setup_name in dependency_runner.setups: - dependencie_identifier = self.combine_names(dependency_runner.name, setup_name.test_file) + dependencie_identifier = self.combine_names(dependency_runner.env_type, setup_name.test_file) results.append(any(dependencie_identifier in f for f in passed_tests)) return all(results) diff --git a/recipes/authentik/tests_authentik/runner_authentik.py b/recipes/authentik/tests_authentik/runner_authentik.py index 41f51a6..b83da2f 100644 --- a/recipes/authentik/tests_authentik/runner_authentik.py +++ b/recipes/authentik/tests_authentik/runner_authentik.py @@ -10,6 +10,6 @@ def condition_always_false(dotenv_config: dict[str, str]) -> bool: class RunnerAuthentik(Runner): - name = "authentik" + env_type = "authentik" setups = [Test(test_file="setup_authentik.py")] # tests = [Test(test_file="test_authentik_dummy.py")] diff --git a/recipes/demo/tests_demo/runner_demo.py b/recipes/demo/tests_demo/runner_demo.py index d84ac2f..2b9aa78 100644 --- a/recipes/demo/tests_demo/runner_demo.py +++ b/recipes/demo/tests_demo/runner_demo.py @@ -4,7 +4,7 @@ from abratest.runner import Runner, Test class RunnerDemo(Runner): """Every env file has a corresponding runner class""" - name: str = "demo" # name of the test, used for logging / output naming + env_type = "demo" # name of the test, used for logging / output naming # this indicates that tests from RunnerDemo depend on the setup from RunnerAuthentik. # RunnerDemo will only execute, when setup_authentik.py has finished successfully. diff --git a/recipes/nextcloud/tests_nextcloud/runner_nextcloud.py b/recipes/nextcloud/tests_nextcloud/runner_nextcloud.py index aa4e89a..5f7fe27 100644 --- a/recipes/nextcloud/tests_nextcloud/runner_nextcloud.py +++ b/recipes/nextcloud/tests_nextcloud/runner_nextcloud.py @@ -6,7 +6,7 @@ def condition_always_false(dotenv_config: dict[str, str]) -> bool: class RunnerNextcloud(Runner): - name: str = "nextcloud" + env_type = "nextcloud" dependencies = ["authentik"] setups = [Test(test_file="setup_nextcloud.py", prevent_skip=False)] tests = [ diff --git a/recipes/wordpress/tests_wordpress/runner_wordpress.py b/recipes/wordpress/tests_wordpress/runner_wordpress.py index 9813142..846f069 100644 --- a/recipes/wordpress/tests_wordpress/runner_wordpress.py +++ b/recipes/wordpress/tests_wordpress/runner_wordpress.py @@ -17,7 +17,7 @@ def condition_has_locale(dotenv_config: dict[str, str]) -> bool: class RunnerWordpress(Runner): - name = "wordpress" + env_type = "wordpress" dependencies = ["authentik"] setups = [Test(test_file="setup_wordpress.py")] tests = [