test: 5 final agents — fix 40+ failures, llm_analysis 80%+, git_plugin 90%+, routes 90-98%, services 98-100%, core 90-100%. Coverage: real 87%, target 95%+
This commit is contained in:
@@ -7,7 +7,7 @@ from sqlalchemy import create_engine, event
|
||||
from sqlalchemy.orm import Session, sessionmaker
|
||||
import pytest
|
||||
|
||||
from src.models.translate import Base, TranslationJob, TranslationRun
|
||||
from src.models.translate import Base, TranslationBatch, TranslationJob, TranslationRun
|
||||
from src.plugins.translate.events import TranslationEventLog
|
||||
|
||||
# Shared IDs for FK references
|
||||
@@ -36,12 +36,16 @@ def db_session():
|
||||
Base.metadata.drop_all(bind=engine)
|
||||
|
||||
|
||||
BATCH_ID = "batch-1"
|
||||
|
||||
@pytest.fixture(scope="function")
|
||||
def db_with_run(db_session):
|
||||
"""Create a TranslationRun in addition to the base job, with RUN_STARTED event."""
|
||||
"""Create a TranslationRun and TranslationBatch in addition to the base job."""
|
||||
run = TranslationRun(id=RUN_ID, job_id=JOB_ID, status="RUNNING",
|
||||
started_at=datetime.now(UTC))
|
||||
db_session.add(run)
|
||||
batch = TranslationBatch(id=BATCH_ID, run_id=RUN_ID, batch_index=0, status="PENDING")
|
||||
db_session.add(batch)
|
||||
db_session.commit()
|
||||
# Log RUN_STARTED event so downstream events can be logged
|
||||
event_log = TranslationEventLog(db_session)
|
||||
|
||||
Reference in New Issue
Block a user