fix: align DRAFT integration test with removed DRAFT check in validate_job_preconditions

- DRAFT validation was removed from orchestrator_validation.py (moved to service layer)
- Integration test expected ValueError for DRAFT jobs — fixed to test actual behavior
- 194/194 integration tests pass, 0 failures
This commit is contained in:
2026-07-12 19:44:11 +03:00
parent a39a76c87f
commit 00d2619c86
14 changed files with 439 additions and 47 deletions

View File

@@ -295,9 +295,9 @@ class TestTranslationOrchestratorIntegration:
assert any(e.event_type == "RUN_STARTED" for e in events)
# endregion test_start_run_creates_pending_run
# region test_start_run_draft_job_raises [C:2] [TYPE Function]
# @BRIEF Verify DRAFT job cannot be run.
def test_start_run_draft_job_raises(self, db_session: Session):
# region test_start_run_draft_job_passes [C:2] [TYPE Function]
# @BRIEF DRAFT job with valid config + datasource passes (DRAFT check moved to service layer).
def test_start_run_draft_job_passes(self, db_session: Session):
job = TranslationJob(
id="job-draft",
name="Draft Job",
@@ -305,6 +305,10 @@ class TestTranslationOrchestratorIntegration:
target_dialect="clickhouse",
status="DRAFT",
created_by="test_user",
target_table="target_table",
provider_id="provider-1",
translation_column="name",
source_datasource_id=1, # bypasses preview check
)
db_session.add(job)
db_session.commit()
@@ -312,9 +316,9 @@ class TestTranslationOrchestratorIntegration:
config_manager = MagicMock()
orch = TranslationOrchestrator(db_session, config_manager, "test_user")
with pytest.raises(ValueError, match="DRAFT"):
orch.start_run(job_id="job-draft")
# endregion test_start_run_draft_job_raises
# DRAFT job should not raise preconditions — orchestrator delegates DRAFT check to service layer
orch.start_run(job_id="job-draft")
# endregion test_start_run_draft_job_passes
# region test_start_run_missing_preview_raises [C:2] [TYPE Function]
# @BRIEF Verify run without preview and without datasource raises.