rework-output-and-test-logic (#3)

* fix flakey tests in authentik / wordpress

* make it possible to rerun tests partially -> passed will be skipped, failed will be repeated

* improve organization of all outputs (moving, renaming, keeping multiple versions etc.)

* add html reports, replace .txt tracebacks

* combine all html reports into one

* add demo runner with comments for documentation purposes

Reviewed-on: local-it-infrastructure/e2e_tests#3
Co-authored-by: Daniel <d.brummerloh@gmail.com>
Co-committed-by: Daniel <d.brummerloh@gmail.com>
This commit is contained in:
Daniel 2023-11-29 14:14:46 +01:00 committed by dan
parent d2cd6ba47f
commit 8172f685de
24 changed files with 588 additions and 418 deletions

View file

@ -1,21 +1,28 @@
from pathlib import Path
from src.runner import Runner, SubTest
from src.tests_authentik.runner_authentik import RunnerAuthentik
def condition_always_true(dotenv_path: Path) -> bool:
def condition_always_true(dotenv_config: dict[str, str]) -> bool:
return True
def condition_always_false(dotenv_path: Path) -> bool:
def condition_always_false(dotenv_config: dict[str, str]) -> bool:
return False
def condition_has_locale(dotenv_config: dict[str, str]) -> bool:
if "LOCALE" in dotenv_config:
if "de" in dotenv_config["LOCALE"]:
return True
return False
class RunnerWordpress(Runner):
name = "wordpress"
test_dir_name = "tests_wordpress"
# main_test_name = "test_wordpress.py"
main_test_name = "test_wordpress.py"
dependencies: list[type[Runner]] = [RunnerAuthentik]
sub_tests = [
SubTest(condition=condition_always_true, test_file="test_wordpress_feature1.py"),
SubTest(condition=condition_has_locale, test_file="test_wordpress_localization.py"),
]
dependencies: list[str] = ["authentik"]
prevent_skip = True