Forward the lab 5 foundation while preserving lab 6 telemetry
Source: immutable lab5 snapshot f88e9ba43cdfd7eb6a5a7ae5feb4247b4e820071; forward the allowed diff from 64d5c67. Carry SQLAlchemy, Alembic, reliability fixes, versioned jobs, infrastructure and student tests without changing protected coursework files.
Validation: make check, validate, lint; 515 student tests passed with one Linux-only skip; public smoke with telemetry enabled and repeat migration passed. Stop the owned stack and retain volumes. Preserve the existing OTel work in progress; grade implementation remains a separate phase.
This commit is contained in:
@@ -4,12 +4,11 @@ import re
|
||||
from typing import Any
|
||||
from uuid import uuid4
|
||||
|
||||
import asyncpg
|
||||
import pytest
|
||||
from httpx import AsyncClient
|
||||
from test_attachments import storage, trio, upload
|
||||
|
||||
from conftest import DATABASE, actor
|
||||
from conftest import actor, sql_connection
|
||||
from messenger.attachments.application.pipeline import TRANSIENT_ERROR
|
||||
from messenger.attachments.application.ports import Rendition
|
||||
from messenger.attachments.domain.errors import ImageTooDemanding
|
||||
@@ -21,11 +20,9 @@ from pipeline import pipeline_of
|
||||
|
||||
|
||||
async def rows(sql: str, *args: Any) -> list[dict[str, Any]]:
|
||||
connection = await asyncpg.connect(DATABASE["url"])
|
||||
try:
|
||||
return [dict(row) for row in await connection.fetch(sql, *args)]
|
||||
finally:
|
||||
await connection.close()
|
||||
async with sql_connection() as connection:
|
||||
result = await connection.exec_driver_sql(sql, args)
|
||||
return [dict(row) for row in result.mappings()] if result.returns_rows else []
|
||||
|
||||
|
||||
async def accepted(http: AsyncClient) -> tuple[dict[str, Any], dict[str, Any], str]:
|
||||
|
||||
Reference in New Issue
Block a user