From 0d34c0a73d09898d3ecee3b8fe3fcfeb1723e08c Mon Sep 17 00:00:00 2001 From: Lars Date: Thu, 14 May 2026 22:35:12 +0200 Subject: [PATCH] Update pytest configuration and documentation for training planning integration - Enhanced the pytest workflow in `.gitea/workflows/test.yml` to include `TRAINING_PLANNING_INTEGRATION` for improved testing against the PostgreSQL database. - Updated `pytest.ini` to clarify integration marker usage, specifying both `ACCESS_LAYER_INTEGRATION` and `TRAINING_PLANNING_INTEGRATION`. - Revised documentation in `test_training_planning_sections_integration.py` to provide clearer activation instructions for local and CI environments. --- .gitea/workflows/test.yml | 4 ++-- backend/pytest.ini | 2 +- .../tests/test_training_planning_sections_integration.py | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.gitea/workflows/test.yml b/.gitea/workflows/test.yml index dd1bd90..b340ef3 100644 --- a/.gitea/workflows/test.yml +++ b/.gitea/workflows/test.yml @@ -10,7 +10,7 @@ on: types: [completed] jobs: - # Wie Mitai-Jinkendo: pytest im laufenden backend-Container (Python aus Image, gleiche DB wie Deploy). + # Pytest im laufenden backend-Container; ACCESS_LAYER + TRAINING_PLANNING Integration gegen dieselbe PostgreSQL wie Deploy (Schema via Container-Start migriert). pytest-backend: if: ${{ github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success' }} runs-on: ubuntu-latest @@ -39,7 +39,7 @@ jobs: cd /app && ACCESS_LAYER_STRICT=1 python scripts/check_access_layer_hints.py && python scripts/security_release_checks.py && - ACCESS_LAYER_INTEGRATION=1 SKIP_DB_MIGRATE=1 python -m pytest tests -m 'not slow' -ra -vv --tb=short + ACCESS_LAYER_INTEGRATION=1 TRAINING_PLANNING_INTEGRATION=1 SKIP_DB_MIGRATE=1 python -m pytest tests -m 'not slow' -ra -vv --tb=short " lint-backend: diff --git a/backend/pytest.ini b/backend/pytest.ini index 3525b2d..54c05d6 100644 --- a/backend/pytest.ini +++ b/backend/pytest.ini @@ -6,5 +6,5 @@ python_functions = test_* addopts = -q --tb=short markers = smoke: Schnelle Kern-Regression. - integration: PostgreSQL-Mandanten-Integration (ACCESS_LAYER_INTEGRATION=1). + integration: PostgreSQL-Integration (z. B. ACCESS_LAYER_INTEGRATION=1, TRAINING_PLANNING_INTEGRATION=1). slow: Lange/schwere Tests; in CI wie Mitai-Jinkendo ausgeschlossen (Auswahl: not slow). diff --git a/backend/tests/test_training_planning_sections_integration.py b/backend/tests/test_training_planning_sections_integration.py index e3d9fe7..fb625f6 100644 --- a/backend/tests/test_training_planning_sections_integration.py +++ b/backend/tests/test_training_planning_sections_integration.py @@ -1,9 +1,9 @@ """ PostgreSQL-Integration: Roundtrip _replace_unit_sections ↔ _fetch_sections. -Aktivierung (lokal, analog zu test_access_layer_integration): - set TRAINING_PLANNING_INTEGRATION=1 - pytest tests/test_training_planning_sections_integration.py -v -m integration +Aktivierung: + - Lokal: TRAINING_PLANNING_INTEGRATION=1 + - CI: .gitea/workflows/test.yml setzt die Variable beim pytest-Lauf (deployter Backend-Container + PostgreSQL). Voraussetzung: migrierte DB, DB_* wie Docker-Compose. """