diff --git a/.gitea/workflows/test.yml b/.gitea/workflows/test.yml index 9932821..14f1101 100644 --- a/.gitea/workflows/test.yml +++ b/.gitea/workflows/test.yml @@ -10,61 +10,36 @@ on: types: [completed] jobs: - # Checkout + PostgreSQL-Service + Migrationen + pytest (Unit + Mandanten-Integration). - # Unabhängig von Self-Host-Pfaden unter lint-backend/build-frontend. + # Wie Mitai-Jinkendo: pytest im laufenden backend-Container (Python aus Image, gleiche DB wie Deploy). pytest-backend: if: ${{ github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success' }} runs-on: ubuntu-latest - services: - postgres: - image: postgres:16-alpine - env: - POSTGRES_USER: shinkan_ci - POSTGRES_PASSWORD: shinkan_ci_secret - POSTGRES_DB: shinkan_ci - ports: - - 5432:5432 - options: >- - --health-cmd "pg_isready -U shinkan_ci -d shinkan_ci" - --health-interval 5s - --health-timeout 5s - --health-retries 12 - env: - DB_HOST: postgres - DB_PORT: "5432" - DB_NAME: shinkan_ci - DB_USER: shinkan_ci - DB_PASSWORD: shinkan_ci_secret - ACCESS_LAYER_INTEGRATION: "1" steps: - - uses: actions/checkout@v4 - - - uses: actions/setup-python@v5 - with: - python-version: "3.12" - - - name: Backend-Abhängigkeiten installieren + - name: Backend pytest im deployten Container run: | - cd backend - python -m pip install --upgrade pip - pip install -r requirements.txt -r requirements-dev.txt + EVENT_NAME="${{ github.event_name }}" + REF_NAME="${{ github.ref_name }}" + RUN_WORKFLOW="${{ github.event.workflow_run.name }}" + APP_DIR="/home/lars/docker/shinkan" + COMPOSE_FILE="docker-compose.yml" - - name: Access-layer Router-Hinweis (strikt) - env: - ACCESS_LAYER_STRICT: "1" - run: python backend/scripts/check_access_layer_hints.py + if [ "$EVENT_NAME" = "workflow_run" ]; then + if [ "$RUN_WORKFLOW" = "Deploy Development" ]; then + APP_DIR="/home/lars/docker/shinkan-dev" + COMPOSE_FILE="docker-compose.dev-env.yml" + fi + elif [ "$REF_NAME" = "develop" ]; then + APP_DIR="/home/lars/docker/shinkan-dev" + COMPOSE_FILE="docker-compose.dev-env.yml" + fi - - name: Datenbankmigrationen anwenden - run: | - cd backend - python run_migrations.py - - - name: pytest (Unit + Integration) - env: - SKIP_DB_MIGRATE: "1" - run: | - cd backend - python -m pytest tests/ -v --tb=short + cd "$APP_DIR" + docker compose -f "$COMPOSE_FILE" exec -T backend sh -lc " + pip install -r /app/requirements-dev.txt && + cd /app && + ACCESS_LAYER_STRICT=1 python scripts/check_access_layer_hints.py && + ACCESS_LAYER_INTEGRATION=1 SKIP_DB_MIGRATE=1 python -m pytest tests -m 'not slow' -ra -vv --tb=short + " lint-backend: if: ${{ github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success' }} diff --git a/backend/pytest.ini b/backend/pytest.ini index 8637782..3525b2d 100644 --- a/backend/pytest.ini +++ b/backend/pytest.ini @@ -1,5 +1,10 @@ [pytest] testpaths = tests pythonpath = . +python_files = test_*.py +python_functions = test_* +addopts = -q --tb=short markers = - integration: PostgreSQL-Mandanten-Integration (ACCESS_LAYER_INTEGRATION=1) + smoke: Schnelle Kern-Regression. + integration: PostgreSQL-Mandanten-Integration (ACCESS_LAYER_INTEGRATION=1). + slow: Lange/schwere Tests; in CI wie Mitai-Jinkendo ausgeschlossen (Auswahl: not slow). diff --git a/backend/version.py b/backend/version.py index 366ab66..3c88bac 100644 --- a/backend/version.py +++ b/backend/version.py @@ -1,6 +1,6 @@ # Shinkan Jinkendo Version Information -APP_VERSION = "0.8.31" +APP_VERSION = "0.8.33" BUILD_DATE = "2026-05-05" DB_SCHEMA_VERSION = "20260505041" @@ -27,6 +27,21 @@ MODULE_VERSIONS = { } CHANGELOG = [ + { + "version": "0.8.33", + "date": "2026-05-05", + "changes": [ + "CI pytest-backend wie Mitai-Jinkendo: docker compose exec backend (deployte Stacks shinkan / shinkan-dev); keine Runner-Python/Postgres-Service", + "pytest.ini: Marker smoke/slow, addopts/-q wie Schwesterprojekt; CI: -m \"not slow\", ACCESS_LAYER_STRICT + Integration im Container", + ], + }, + { + "version": "0.8.32", + "date": "2026-05-05", + "changes": [ + "CI pytest-backend: kein setup-python — venv aus System-python3 (arm64/Debian Self-Host, Raspi)", + ], + }, { "version": "0.8.31", "date": "2026-05-05", diff --git a/frontend/src/version.js b/frontend/src/version.js index 302f8e9..b47c1d1 100644 --- a/frontend/src/version.js +++ b/frontend/src/version.js @@ -1,6 +1,6 @@ // Shinkan Jinkendo Frontend Version -export const APP_VERSION = "0.8.31" +export const APP_VERSION = "0.8.33" export const BUILD_DATE = "2026-05-05" export const PAGE_VERSIONS = {