diff --git a/bfabric_app_runner/pyproject.toml b/bfabric_app_runner/pyproject.toml index c05003850..bcb53625c 100644 --- a/bfabric_app_runner/pyproject.toml +++ b/bfabric_app_runner/pyproject.toml @@ -51,7 +51,7 @@ dev = [ "mypy", "types-PyYAML", ] -test = ["pytest", "pytest-mock", "logot", "pyfakefs", "inline-snapshot"] +test = ["pytest", "pytest-mock", "logot", "pyfakefs", "inline-snapshot", "pytest-bdd"] [tool.uv] reinstall-package = ["bfabric", "bfabric_scripts", "bfabric_app_runner"] diff --git a/tests/bfabric_app_runner/features/workflowstep_integration.feature b/tests/bfabric_app_runner/features/workflowstep_integration.feature new file mode 100644 index 000000000..8d4f4b9e5 --- /dev/null +++ b/tests/bfabric_app_runner/features/workflowstep_integration.feature @@ -0,0 +1,38 @@ +Feature: Workflowstep Integration + Automatic workflowstep creation when workflow_template_step_id is configured in app YAML + + Background: + Given a bfabric client and workunit definition exist + + Scenario: Workunit fails + Given app YAML has workflow_template_step_id configured + And the workflow template step exists + When workunit execution fails + Then no workflowstep is created + + Scenario: Workunit succeeds with valid template + Given app YAML has workflow_template_step_id configured + And the workflow template step exists + When workunit execution succeeds + Then a workflowstep is created and linked to the workunit + + Scenario: Workunit succeeds but template not found + Given app YAML has workflow_template_step_id configured + And the workflow template step does not exist + When workunit execution succeeds + Then no workflowstep is created + And an error is logged about misconfigured template + But workunit remains successful + + Scenario: Workunit succeeds but workflowstep already exists + Given app YAML has workflow_template_step_id configured + And the workflow template step exists + And a workflowstep already exists for this workunit + When workunit execution succeeds + Then no duplicate workflowstep is created + And existing workflowstep is preserved + + Scenario: No workflow template configured + Given app YAML has no workflow_template_step_id + When workunit execution succeeds + Then no workflowstep is created