fix: remove alembic from CI tests, drop_all before create_all in conftest
Some checks failed
Tests / Backend Tests (push) Failing after 1m2s
Tests / Frontend Tests (push) Failing after 40s

This commit is contained in:
Faultier314
2026-04-06 10:27:23 +02:00
parent 0c55d2cb49
commit e05cf90c5b
2 changed files with 2 additions and 7 deletions

View File

@@ -42,12 +42,6 @@ jobs:
- name: Install dependencies
run: pip install -r backend/requirements.txt -r backend/requirements-test.txt
- name: Run migrations
working-directory: backend
env:
DATABASE_URL: postgresql+asyncpg://test:test@postgres:5432/gartenmanager_test
run: alembic upgrade head
- name: Run tests
working-directory: backend
env:

View File

@@ -33,6 +33,8 @@ def event_loop():
@pytest_asyncio.fixture(scope="session")
async def setup_database():
async with _engine.begin() as conn:
# drop_all first to clean up from any previous interrupted run
await conn.run_sync(Base.metadata.drop_all)
await conn.run_sync(Base.metadata.create_all)
yield
async with _engine.begin() as conn:
@@ -98,7 +100,6 @@ async def test_user(db: AsyncSession, test_tenant: Tenant):
await db.flush()
db.add(UserTenant(user_id=user.id, tenant_id=test_tenant.id, role=TenantRole.READ_WRITE))
await db.commit()
# Attach plaintext password for use in auth fixtures
user._plain_password = password # type: ignore[attr-defined]
yield user