Promote dev → uat: remove invalid CI deploy jobs (CAR-1069) (#38)
CI / lint (push) Failing after 3s
CI / test (push) Failing after 17s
CI / build-and-push (push) Has been skipped
CI / typecheck (push) Failing after 29s

This commit was merged in pull request #38.
This commit is contained in:
2026-05-27 01:57:23 +00:00
parent 0c0cc63d59
commit 7c5ee9bdc0
4 changed files with 42 additions and 96 deletions
+22 -9
View File
@@ -51,12 +51,21 @@ def disable_rate_limiting():
@pytest.fixture
def engine():
"""Sync in-memory SQLite engine for model unit tests."""
eng = create_engine("sqlite:///:memory:")
from cartsnitch_api.models.user import User
"""Sync in-memory SQLite engine for model unit tests.
Strips PostgreSQL-specific server_default expressions so SQLite can
handle all column inserts without missing-function errors.
"""
eng = create_engine("sqlite:///:memory:")
for table in Base.metadata.tables.values():
for col in table.columns.values():
sd = col.server_default
if sd is not None:
expr_str = str(sd.expression).lower()
if "gen_random_uuid" in expr_str or "gen_random_bytes" in expr_str:
col.server_default = None
col = User.__table__.columns["email_inbound_token"]
col.server_default = None
Base.metadata.create_all(eng)
yield eng
eng.dispose()
@@ -80,12 +89,16 @@ async def db_engine():
cursor.execute("PRAGMA foreign_keys=ON")
cursor.close()
async with engine.begin() as conn:
from cartsnitch_api.models.user import User
for table in Base.metadata.tables.values():
for col in table.columns.values():
sd = col.server_default
if sd is not None:
expr_str = str(sd.expression).lower()
if "gen_random_uuid" in expr_str or "gen_random_bytes" in expr_str:
col.server_default = None
User.__table__.columns["email_inbound_token"].server_default = None
async with engine.begin() as conn:
await conn.run_sync(Base.metadata.create_all)
# Create Better-Auth tables (not managed by SQLAlchemy models)
await conn.execute(
text("""
CREATE TABLE IF NOT EXISTS sessions (