Run the dev test suite once, after the deploy.
Deploy Development / deploy (push) Successful in 54s

The compose check looked for docker-compose.yml inside the backend image, where that file is not copied. A push no longer starts a second suite in parallel with the deploy.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
LarsandCursor committed 2026-10-28 11:36:56 +01:00
1 parent 95d365d9fa
commit d4a193607f
2 files changed
+18 -8

No files matched your search

+5 -5
View File
@@ -1,11 +1,11 @@
name: Test Suite
# develop: push/PR → Tests gegen Dev (parallel oder vor Deploy Development).
# main: kein push/PR-Trigger — vermeidet doppelten Dev-Lauf beim Merge develop→main;
# Prod-Tests nur via workflow_run nach erfolgreichem Deploy Production.
# develop: eine Suite, erst nach erfolgreichem Deploy Development (workflow_run).
# Kein push-Trigger: der würde parallel zum Deploy ein zweites Mal starten
# und gegen den noch alten oder gerade neu startenden Stack laufen.
# pull_request: eine Suite vor dem Merge, gegen den zuletzt deployten Dev-Stand.
# main: kein push/PR — Prod-Tests nur via workflow_run nach Deploy Production.
on:
push:
branches: [develop]
pull_request:
branches: [develop]
workflow_run:
@@ -16,8 +16,15 @@ from scripts.media_retention_scheduler import (
)
BERLIN = ZoneInfo("Europe/Berlin")
REPO = Path(__file__).resolve().parents[2]
COMPOSE = REPO / "docker-compose.yml"
def _compose_file() -> Path | None:
"""Repo-Root lokal. Im Backend-Image liegt nur /app, ohne docker-compose.yml."""
for parent in Path(__file__).resolve().parents:
candidate = parent / "docker-compose.yml"
if candidate.is_file():
return candidate
return None
def test_winter_afternoon_waits_until_next_morning() -> None:
@@ -148,7 +155,10 @@ def test_run_job_logs_success(
def test_compose_starts_scheduler_script() -> None:
text = COMPOSE.read_text(encoding="utf-8")
compose = _compose_file()
if compose is None:
pytest.skip("docker-compose.yml liegt nicht im Backend-Image")
text = compose.read_text(encoding="utf-8")
start = text.index(" retention-cron:")
block = text[start : text.index("\nvolumes:", start)]
assert 'command: ["python", "-u", "scripts/media_retention_scheduler.py"]' in block