authentik setup and tracing #2
2 changed files with 14 additions and 12 deletions
15
main.py
15
main.py
|
|
@ -1,11 +1,22 @@
|
||||||
import os
|
import os
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
from src.utils import get_session_id
|
from src.utils import get_session_id
|
||||||
from src.wrapper import ENV_FILES, Wrapper
|
from src.wrapper import Wrapper
|
||||||
|
|
||||||
|
ENV_FILES = [
|
||||||
|
Path("envfiles/login.test.dev.local-it.cloud.env"), # authentik
|
||||||
|
# Path("envfiles/blog.test.dev.local-it.cloud.env"), # wordpress
|
||||||
|
]
|
||||||
|
|
||||||
|
TESTS_DIR = Path("./tests").resolve()
|
||||||
|
|
||||||
|
|
||||||
# Set environment variables
|
# Set environment variables
|
||||||
|
|
||||||
os.environ["PWDEBUG"] = "1"
|
# os.environ["PWDEBUG"] = "1"
|
||||||
|
os.environ["TESTS_DIR"] = str(TESTS_DIR)
|
||||||
|
|
||||||
|
|
||||||
session_id = get_session_id()
|
session_id = get_session_id()
|
||||||
wrapper = Wrapper(ENV_FILES, session_id=session_id)
|
wrapper = Wrapper(ENV_FILES, session_id=session_id)
|
||||||
|
|
|
||||||
|
|
@ -1,21 +1,12 @@
|
||||||
from datetime import datetime
|
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import Protocol
|
from typing import Protocol
|
||||||
|
|
||||||
from dotenv import dotenv_values
|
from dotenv import dotenv_values
|
||||||
from icecream import ic
|
|
||||||
|
|
||||||
from src.dirmanager import DirManager
|
from src.dirmanager import DirManager
|
||||||
from src.tests_authentik.runner_authentik import RunnerAuthentik
|
from src.tests_authentik.runner_authentik import RunnerAuthentik
|
||||||
from src.tests_wordpress.runner_wordpress import RunnerWordpress
|
from src.tests_wordpress.runner_wordpress import RunnerWordpress
|
||||||
|
|
||||||
TESTS_DIR = Path("./tests").resolve()
|
|
||||||
|
|
||||||
ENV_FILES = [
|
|
||||||
Path("envfiles/login.test.dev.local-it.cloud.env"), # authentik
|
|
||||||
# Path("envfiles/blog.test.dev.local-it.cloud.env"), # wordpress
|
|
||||||
]
|
|
||||||
|
|
||||||
|
|
||||||
class TestRunner(Protocol):
|
class TestRunner(Protocol):
|
||||||
def __init__(self, dotenv_path: Path, tests_dir: Path, session_id: str):
|
def __init__(self, dotenv_path: Path, tests_dir: Path, session_id: str):
|
||||||
|
|
@ -55,7 +46,7 @@ class Wrapper:
|
||||||
def _load_runners(self, env_files: list[Path]) -> list[TestRunner]:
|
def _load_runners(self, env_files: list[Path]) -> list[TestRunner]:
|
||||||
runners = []
|
runners = []
|
||||||
for env_file in env_files:
|
for env_file in env_files:
|
||||||
config: dict[str, str] = dotenv_values(env_file)
|
config: dict[str, str] = dotenv_values(env_file) # type: ignore
|
||||||
RunnerClass = RUNNER_DICT[config["TYPE"]]
|
RunnerClass = RUNNER_DICT[config["TYPE"]]
|
||||||
runners.append(RunnerClass(dotenv_path=env_file, tests_dir=TESTS_DIR, session_id=self.session_id))
|
runners.append(RunnerClass(dotenv_path=env_file, tests_dir=TESTS_DIR, session_id=self.session_id))
|
||||||
return runners
|
return runners
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue