feat: complete production workflow migration

This commit is contained in:
2026-08-06 14:29:57 +08:00
parent 7f215e79c4
commit 8df5266abb
448 changed files with 56937 additions and 14619 deletions
+13 -14
View File
@@ -40,7 +40,7 @@ class RecordingStep:
return StepExecution(exit_code=0)
def test_default_cli_registry_exposes_all_21_migrated_scheduled_workflows(
def test_default_cli_registry_exposes_all_project_scheduled_workflows(
tmp_path: Path,
) -> None:
project_root = Path(__file__).parents[1]
@@ -48,10 +48,14 @@ def test_default_cli_registry_exposes_all_21_migrated_scheduled_workflows(
Settings(project_root=project_root, data_root=tmp_path)
)
assert sum(
registry.is_registered(entry.workflow_id)
for entry in registry.catalog.scheduled_workflows()
) == 21
scheduled_ids = {
entry.workflow_id for entry in registry.catalog.scheduled_workflows()
}
assert len(scheduled_ids) == 23
assert scheduled_ids == {
schedule.workflow_id for schedule in registry.catalog.schedules
}
assert all(registry.is_registered(workflow_id) for workflow_id in scheduled_ids)
def _catalog(tmp_path: Path) -> WorkflowCatalog:
@@ -60,7 +64,7 @@ def _catalog(tmp_path: Path) -> WorkflowCatalog:
(config / "workflows.json").write_text(
json.dumps(
{
"schema_version": 2,
"schema_version": 3,
"workflows": [
{
"id": "shop.metrics.weekly",
@@ -126,7 +130,7 @@ def _invoke(
return code, stdout.getvalue(), stderr.getvalue()
def test_list_reports_catalog_and_registration_state_as_json(tmp_path: Path) -> None:
def test_list_reports_only_scheduled_catalog_entries_as_json(tmp_path: Path) -> None:
action = RecordingStep()
registry, settings = _runtime(
tmp_path,
@@ -142,17 +146,12 @@ def test_list_reports_catalog_and_registration_state_as_json(tmp_path: Path) ->
rows = json.loads(output)
assert rows == [
{
"enabled": True,
"id": "shop.metrics.weekly",
"module": "shop_intelligence",
"registered": True,
"trigger": "scheduled",
},
{
"id": "shop.missing",
"module": "shop_intelligence",
"registered": False,
"trigger": "unavailable",
},
}
]