Ergaenze die Kansho-analoge Test-Suite gegen buyingagent_test.
Deploy Development / deploy (push) Successful in 24s
Test Suite / pytest-backend (push) Failing after 14s
Test Suite / smoke-dev (push) Successful in 0s

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
LarsandCursor committed 2026-10-03 11:20:30 +02:00
1 parent e1800e7b0f
commit c9c0ff96fc
9 files changed
+138 -5

No files matched your search

+40
View File
@@ -0,0 +1,40 @@
import pytest
from fastapi.testclient import TestClient
from sqlalchemy import text
from alembic.config import Config
from alembic.runtime.migration import MigrationContext
from alembic.script import ScriptDirectory
from app.main import app
from app.persistence.db import engine
pytestmark = pytest.mark.integration
client = TestClient(app)
@pytest.fixture(scope="module", autouse=True)
def require_postgres() -> None:
try:
with engine.connect() as connection:
connection.execute(text("SELECT 1"))
except Exception as exc:
pytest.skip(f"PostgreSQL not available: {exc}")
def test_health_ready_when_migrated() -> None:
response = client.get("/health/ready")
assert response.status_code == 200
body = response.json()
assert body["status"] == "ready"
assert "environment" in body
assert "engine_build" in body
def test_alembic_is_at_head() -> None:
config = Config("alembic.ini")
script = ScriptDirectory.from_config(config)
with engine.connect() as connection:
context = MigrationContext.configure(connection)
assert set(context.get_current_heads()) == set(script.get_heads())