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
4 changes: 2 additions & 2 deletions src/aws_durable_execution_sdk_python_testing/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ def get_durable_execution_history_command(self, args: argparse.Namespace) -> int
def _create_boto3_client(
self, endpoint_url: str | None = None, region_name: str | None = None
) -> Any:
"""Create boto3 client for lambdainternal-local service.
"""Create boto3 client for lambdainternal service.

Args:
endpoint_url: Optional endpoint URL override
Expand All @@ -481,7 +481,7 @@ def _create_boto3_client(

# Create client with local endpoint - no AWS access keys required
return boto3.client(
"lambdainternal-local",
"lambdainternal",
endpoint_url=final_endpoint,
region_name=final_region,
)
Expand Down
2 changes: 0 additions & 2 deletions src/aws_durable_execution_sdk_python_testing/invoker.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ def create_invocation_input(
operations=execution.operations,
next_marker="",
),
is_local_runner=False,
service_client=self.service_client,
)

Expand Down Expand Up @@ -135,7 +134,6 @@ def create_invocation_input(
operations=execution.operations,
next_marker="",
),
is_local_runner=False,
)

def invoke(
Expand Down
6 changes: 3 additions & 3 deletions src/aws_durable_execution_sdk_python_testing/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -850,13 +850,13 @@ def stop(self) -> None:
self._executor = None

def _create_boto3_client(self) -> Any:
"""Create boto3 client for lambdainternal-local service.
"""Create boto3 client for lambdainternal service.

Configures AWS data path and creates a boto3 client with the
local runner endpoint and region from configuration.

Returns:
Configured boto3 client for lambdainternal-local service
Configured boto3 client for lambdainternal service

Raises:
Exception: If client creation fails - exceptions propagate naturally
Expand All @@ -869,7 +869,7 @@ def _create_boto3_client(self) -> Any:

# Create client with Lambda endpoint configuration
return boto3.client(
"lambdainternal-local",
"lambdainternal",
endpoint_url=self._config.lambda_endpoint,
region_name=self._config.local_runner_region,
)
Expand Down
2 changes: 1 addition & 1 deletion tests/cli_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1004,7 +1004,7 @@ def test_create_boto3_client_sets_up_aws_data_path() -> None:

# Verify boto3 client is created with correct parameters
mock_boto3_client.assert_called_once_with(
"lambdainternal-local",
"lambdainternal",
endpoint_url=app.config.local_runner_endpoint,
region_name=app.config.local_runner_region,
)
Expand Down
16 changes: 0 additions & 16 deletions tests/invoker_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ def test_in_process_invoker_create_invocation_input():
assert invocation_input.durable_execution_arn == execution.durable_execution_arn
assert invocation_input.checkpoint_token is not None
assert isinstance(invocation_input.initial_execution_state, InitialExecutionState)
assert invocation_input.is_local_runner is False
assert invocation_input.service_client is service_client


Expand All @@ -86,7 +85,6 @@ def test_in_process_invoker_invoke():
durable_execution_arn="test-arn",
checkpoint_token="test-token", # noqa: S106
initial_execution_state=InitialExecutionState(operations=[], next_marker=""),
is_local_runner=False,
)

result = invoker.invoke("test-function", input_data)
Expand Down Expand Up @@ -149,7 +147,6 @@ def test_lambda_invoker_create_invocation_input():
assert invocation_input.durable_execution_arn == execution.durable_execution_arn
assert invocation_input.checkpoint_token is not None
assert isinstance(invocation_input.initial_execution_state, InitialExecutionState)
assert invocation_input.is_local_runner is False


def test_lambda_invoker_invoke_success():
Expand All @@ -173,7 +170,6 @@ def test_lambda_invoker_invoke_success():
durable_execution_arn="test-arn",
checkpoint_token="test-token", # noqa: S106
initial_execution_state=InitialExecutionState(operations=[], next_marker=""),
is_local_runner=False,
)

result = invoker.invoke("test-function", input_data)
Expand Down Expand Up @@ -211,7 +207,6 @@ def test_lambda_invoker_invoke_failure():
durable_execution_arn="test-arn",
checkpoint_token="test-token", # noqa: S106
initial_execution_state=InitialExecutionState(operations=[], next_marker=""),
is_local_runner=False,
)

with pytest.raises(
Expand Down Expand Up @@ -286,7 +281,6 @@ def test_lambda_invoker_invoke_empty_function_name():
durable_execution_arn="test-arn",
checkpoint_token="test-token",
initial_execution_state=InitialExecutionState(operations=[], next_marker=""),
is_local_runner=False,
)

with pytest.raises(
Expand All @@ -308,7 +302,6 @@ def test_lambda_invoker_invoke_whitespace_function_name():
durable_execution_arn="test-arn",
checkpoint_token="test-token",
initial_execution_state=InitialExecutionState(operations=[], next_marker=""),
is_local_runner=False,
)

with pytest.raises(
Expand Down Expand Up @@ -337,7 +330,6 @@ def test_lambda_invoker_invoke_status_202():
durable_execution_arn="test-arn",
checkpoint_token="test-token",
initial_execution_state=InitialExecutionState(operations=[], next_marker=""),
is_local_runner=False,
)

result = invoker.invoke("test-function", input_data)
Expand Down Expand Up @@ -367,7 +359,6 @@ def test_lambda_invoker_invoke_function_error():
durable_execution_arn="test-arn",
checkpoint_token="test-token",
initial_execution_state=InitialExecutionState(operations=[], next_marker=""),
is_local_runner=False,
)

with pytest.raises(
Expand Down Expand Up @@ -446,7 +437,6 @@ class MockResourceNotFoundException(Exception):
durable_execution_arn="test-arn",
checkpoint_token="test-token",
initial_execution_state=InitialExecutionState(operations=[], next_marker=""),
is_local_runner=False,
)

with pytest.raises(
Expand Down Expand Up @@ -481,7 +471,6 @@ class MockInvalidParameterValueException(Exception):
durable_execution_arn="test-arn",
checkpoint_token="test-token",
initial_execution_state=InitialExecutionState(operations=[], next_marker=""),
is_local_runner=False,
)

with pytest.raises(InvalidParameterValueException, match="Invalid parameter"):
Expand Down Expand Up @@ -510,7 +499,6 @@ class MockServiceException(Exception):
durable_execution_arn="test-arn",
checkpoint_token="test-token",
initial_execution_state=InitialExecutionState(operations=[], next_marker=""),
is_local_runner=False,
)

with pytest.raises(DurableFunctionsTestError, match="Lambda invocation failed"):
Expand Down Expand Up @@ -539,7 +527,6 @@ class MockEC2Exception(Exception):
durable_execution_arn="test-arn",
checkpoint_token="test-token",
initial_execution_state=InitialExecutionState(operations=[], next_marker=""),
is_local_runner=False,
)

with pytest.raises(DurableFunctionsTestError, match="Lambda infrastructure error"):
Expand Down Expand Up @@ -568,7 +555,6 @@ class MockKMSException(Exception):
durable_execution_arn="test-arn",
checkpoint_token="test-token",
initial_execution_state=InitialExecutionState(operations=[], next_marker=""),
is_local_runner=False,
)

with pytest.raises(DurableFunctionsTestError, match="Lambda KMS error"):
Expand Down Expand Up @@ -600,7 +586,6 @@ class MockDurableExecutionAlreadyStartedException(Exception):
durable_execution_arn="test-arn",
checkpoint_token="test-token",
initial_execution_state=InitialExecutionState(operations=[], next_marker=""),
is_local_runner=False,
)

with pytest.raises(
Expand All @@ -624,7 +609,6 @@ def test_lambda_invoker_invoke_unexpected_exception():
durable_execution_arn="test-arn",
checkpoint_token="test-token",
initial_execution_state=InitialExecutionState(operations=[], next_marker=""),
is_local_runner=False,
)

with pytest.raises(
Expand Down
6 changes: 3 additions & 3 deletions tests/runner_web_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ def test_should_handle_boto3_client_creation_with_custom_config():

# Assert - Verify boto3 client was called with correct parameters
mock_boto3_client.assert_called_once_with(
"lambdainternal-local",
"lambdainternal",
endpoint_url="http://custom-endpoint:8080",
region_name="eu-west-1",
)
Expand All @@ -442,7 +442,7 @@ def test_should_handle_boto3_client_creation_with_defaults():

# Assert - Verify boto3 client was called with default parameters
mock_boto3_client.assert_called_once_with(
"lambdainternal-local",
"lambdainternal",
endpoint_url="http://127.0.0.1:3001", # Default lambda_endpoint value
region_name="us-west-2", # Default value
)
Expand Down Expand Up @@ -773,7 +773,7 @@ def test_should_pass_correct_boto3_client_to_lambda_invoker():

# Assert - Verify boto3 client was created with correct parameters
mock_boto3_client.assert_called_once_with(
"lambdainternal-local",
"lambdainternal",
endpoint_url="http://test-endpoint:7777",
region_name="ap-southeast-2",
)
Expand Down
Loading