fix(dsh): reconcile resumed progress with checkpoint evidence
This commit is contained in:
1 parent
d3bdff81e5
commit
5cb8b6ac83
8 files changed
+187
-3
No files matched your search
@@ -4,6 +4,7 @@ from types import SimpleNamespace as NS
|
||||
import pytest
|
||||
|
||||
from dx_productivity.dsh.cad_verification import CadVerificationAdapter
|
||||
from test_run_journal import project_service, evidence
|
||||
|
||||
|
||||
def service(tmp_path, *, probe=True, interrupted=False):
|
||||
@@ -43,3 +44,24 @@ def test_adapter_rejects_missing_task_without_inventing_counts(tmp_path):
|
||||
result = CadVerificationAdapter(svc).preflight(['missing'])
|
||||
assert result['status'] == 'blocked'
|
||||
assert result['projects'][0]['component_count'] is None
|
||||
|
||||
|
||||
@pytest.mark.parametrize('state,blocker', [('batch_failed', 'failed_items'), (None, 'queue_incomplete')])
|
||||
def test_after_run_requires_successful_complete_evidence(project_service, state, blocker):
|
||||
service, _, _, ids, _ = project_service
|
||||
if state:
|
||||
evidence(service, ids[0], state)
|
||||
context = service.task_context(ids[0])
|
||||
assert context.progress.failed_items == (1 if state else 0)
|
||||
assert not context.interrupted
|
||||
result = CadVerificationAdapter(service).after_run(ids[:1])
|
||||
assert result['status'] == 'uncertain'
|
||||
assert blocker in result['blockers']
|
||||
|
||||
|
||||
def test_after_run_keeps_verified_no_match_distinct_from_saved(project_service):
|
||||
service, _, _, ids, _ = project_service
|
||||
evidence(service, ids[0])
|
||||
result = CadVerificationAdapter(service).after_run(ids[:1])
|
||||
assert result['status'] == 'ready' and result['blockers'] == []
|
||||
assert result['tasks'][0]['saved_items'] == 0 and result['tasks'][0]['no_match_items'] == 1
|
||||
Reference in new issue
Block a user