feat: complete production workflow migration
This commit is contained in:
@@ -5,7 +5,6 @@ from pathlib import Path
|
||||
from gyxx_flow.adapters.native import DeferredModuleCommandStep
|
||||
from gyxx_flow.catalog import WorkflowCatalog
|
||||
from gyxx_flow.modules.content_marketing import (
|
||||
CONTENT_MANUAL_WORKFLOW_IDS,
|
||||
CONTENT_RESOURCE,
|
||||
CONTENT_SCHEDULED_WORKFLOW_IDS,
|
||||
CONTENT_TIMEOUT_SECONDS,
|
||||
@@ -16,15 +15,14 @@ from gyxx_flow.modules.content_marketing import (
|
||||
PROJECT_ROOT = Path(__file__).resolve().parents[1]
|
||||
|
||||
|
||||
def test_content_module_registers_all_scheduled_and_manual_entries() -> None:
|
||||
def test_content_module_registers_only_scheduled_entries() -> None:
|
||||
module = ContentMarketingModule.from_catalog(
|
||||
WorkflowCatalog.load(PROJECT_ROOT / "config")
|
||||
)
|
||||
|
||||
definitions = module.workflow_definitions()
|
||||
assert tuple(item.workflow_id for item in definitions) == CONTENT_WORKFLOW_IDS
|
||||
assert len(CONTENT_SCHEDULED_WORKFLOW_IDS) == 9
|
||||
assert len(CONTENT_MANUAL_WORKFLOW_IDS) == 3
|
||||
assert len(CONTENT_SCHEDULED_WORKFLOW_IDS) == 8
|
||||
|
||||
|
||||
def test_content_workflows_use_project_owned_module_commands() -> None:
|
||||
@@ -33,11 +31,15 @@ def test_content_workflows_use_project_owned_module_commands() -> None:
|
||||
)
|
||||
|
||||
for definition in module.workflow_definitions():
|
||||
step = definition.steps[0]
|
||||
assert step.step_id == "module_run"
|
||||
assert isinstance(step.action, DeferredModuleCommandStep)
|
||||
assert step.timeout_seconds == CONTENT_TIMEOUT_SECONDS == 4 * 60 * 60
|
||||
assert step.max_attempts == 1
|
||||
assert step.resources == (CONTENT_RESOURCE,) == ("module:content_marketing",)
|
||||
assert step.production_sink is True
|
||||
|
||||
assert definition.steps
|
||||
for step in definition.steps:
|
||||
assert isinstance(step.action, DeferredModuleCommandStep)
|
||||
assert step.timeout_seconds == CONTENT_TIMEOUT_SECONDS == 4 * 60 * 60
|
||||
assert step.max_attempts == 1
|
||||
if definition.workflow_id == "content.comments.weekly":
|
||||
assert step.resources == (f"{CONTENT_RESOURCE}:{step.step_id}",)
|
||||
else:
|
||||
assert step.resources == (CONTENT_RESOURCE,) == (
|
||||
"module:content_marketing",
|
||||
)
|
||||
assert step.production_sink is True
|
||||
|
||||
Reference in New Issue
Block a user