Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,7 @@ def _record_fire_and_forget_action(self, action: Action):
else:
new_action = [action]
self._add_to_actions(new_action)
self._sequence_number += 1

def signal_entity(self, entityId: EntityId,
operationName: str, operationInput: Optional[Any] = None):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
from .Action import Action
from .ActionType import ActionType
from ..utils.json_utils import add_attrib
from json import dumps
from azure.functions._durable_functions import _serialize_custom_object


class ContinueAsNewAction(Action):
Expand All @@ -13,7 +15,7 @@ class ContinueAsNewAction(Action):
"""

def __init__(self, input_=None):
self.input_ = input_
self.input_ = dumps(input_, default=_serialize_custom_object)

@property
def action_type(self) -> int:
Expand Down
18 changes: 18 additions & 0 deletions tests/orchestrator/test_entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,24 @@ def test_signal_entity_sent():
#assert_valid_schema(result)
assert_orchestration_state_equals(expected, result)

def test_signal_entity_sent_and_response_received():
entityId = df.EntityId("Counter", "myCounter")
context_builder = ContextBuilder('test_simple_function')
add_call_entity_completed_events(context_builder, "get", df.EntityId.get_scheduler_id(entityId), 3, 1)


result = get_orchestration_state_result(
context_builder, generator_function_signal_entity)

expected_state = base_expected_state([3])
add_signal_entity_action(expected_state, entityId, "add", 3)
add_call_entity_action(expected_state, entityId, "get", None)
expected_state._is_done = True
expected = expected_state.to_json()

#assert_valid_schema(result)
assert_orchestration_state_equals(expected, result)


def test_call_entity_raised():
entityId = df.EntityId("Counter", "myCounter")
Expand Down