From e415b8a16a4ff5fad232a3b25c0e242f1671ea85 Mon Sep 17 00:00:00 2001 From: Daniel Date: Tue, 5 Dec 2023 23:19:44 +0100 Subject: [PATCH] fully remove test_dir_name --- abratest/runner.py | 6 ++++-- recipes/authentik/tests_authentik/runner_authentik.py | 1 - recipes/demo/tests_demo/runner_demo.py | 1 - recipes/nextcloud/tests_nextcloud/runner_nextcloud.py | 1 - recipes/wordpress/tests_wordpress/runner_wordpress.py | 1 - 5 files changed, 4 insertions(+), 6 deletions(-) diff --git a/abratest/runner.py b/abratest/runner.py index 79545b6..adc6ba0 100644 --- a/abratest/runner.py +++ b/abratest/runner.py @@ -19,7 +19,6 @@ class Test: class Runner: name: str = "" - test_dir_name: str = "" setups: list[Test] = [] tests: list[Test] = [] cleanups: list[Test] = [] @@ -69,7 +68,10 @@ class Runner: # condition_met: true / false identifier_string = self.combine_names(self.name, test.test_file) - full_test_path = self.DIR.RECIPES / self.name / self.test_dir_name / 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" + full_test_path = results[0] # check if test aleady passed if self._is_test_passed(identifier_string, remove_existing=True): diff --git a/recipes/authentik/tests_authentik/runner_authentik.py b/recipes/authentik/tests_authentik/runner_authentik.py index a3bba32..41f51a6 100644 --- a/recipes/authentik/tests_authentik/runner_authentik.py +++ b/recipes/authentik/tests_authentik/runner_authentik.py @@ -11,6 +11,5 @@ def condition_always_false(dotenv_config: dict[str, str]) -> bool: class RunnerAuthentik(Runner): name = "authentik" - test_dir_name = "tests_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 ab2618c..d84ac2f 100644 --- a/recipes/demo/tests_demo/runner_demo.py +++ b/recipes/demo/tests_demo/runner_demo.py @@ -5,7 +5,6 @@ class RunnerDemo(Runner): """Every env file has a corresponding runner class""" name: str = "demo" # name of the test, used for logging / output naming - test_dir_name: str = "tests_demo" # dir name holding all tests related to RunnerDemo # 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 8ea7063..aa4e89a 100644 --- a/recipes/nextcloud/tests_nextcloud/runner_nextcloud.py +++ b/recipes/nextcloud/tests_nextcloud/runner_nextcloud.py @@ -7,7 +7,6 @@ def condition_always_false(dotenv_config: dict[str, str]) -> bool: class RunnerNextcloud(Runner): name: str = "nextcloud" - test_dir_name: str = "tests_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 7167ce8..9813142 100644 --- a/recipes/wordpress/tests_wordpress/runner_wordpress.py +++ b/recipes/wordpress/tests_wordpress/runner_wordpress.py @@ -18,7 +18,6 @@ def condition_has_locale(dotenv_config: dict[str, str]) -> bool: class RunnerWordpress(Runner): name = "wordpress" - test_dir_name = "tests_wordpress" dependencies = ["authentik"] setups = [Test(test_file="setup_wordpress.py")] tests = [