8000 [SFN] Support for SFN and Sync, reworked exception handling, fixes, tests by MEPalma · Pull Request #8623 · localstack/localstack · GitHub
[go: up one dir, main page]

Skip to content

[SFN] Support for SFN and Sync, reworked exception handling, fixes, tests #8623

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 43 commits into from
Jul 14, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
3b0c2e9
base
MEPalma May 8, 2023
2f392e7
fixes
MEPalma May 10, 2023
4d63d30
update snap test
MEPalma May 10, 2023
21f10ee
reworked parameters, improved double dep of lambda state tasks, tests
MEPalma May 11, 2023
0b750d2
minor conflicts
MEPalma May 16, 2023
0cd04f9
Merge branch 'MEP-sfn-callbacks' into MEP-sfn-lambda-fix-params
MEPalma May 16, 2023
d2f539b
Merge branch 'master' into MEP-sfn-lambda-fix-params
MEPalma May 24, 2023
a24ee43
timeouts support
MEPalma May 26, 2023
f07015a
Merge branch 'master' into MEP-sfn-lambda-fix-params
MEPalma May 27, 2023
eb5f0ea
task failure support and tests
MEPalma May 29, 2023
1382972
heartbeat base support
MEPalma May 29, 2023
4c75562
provider
MEPalma May 29, 2023
4f83e57
heartbeat tests, fixes
MEPalma Jun 2, 2023
406f3c0
Merge branch 'master' into MEP-sfn-timeout
MEPalma Jun 21, 2023
ae5ee1e
minor
MEPalma Jun 21, 2023
d0a65b1
pr items
MEPalma Jun 22, 2023
2682ffa
minor cleanup
MEPalma Jun 22, 2023
95ee8e0
Merge branch 'master' into MEP-sfn-timeout
MEPalma Jun 22, 2023
07107db
conflicts, minors
MEPalma Jun 22, 2023
de9a320
fix cycle on send success
MEPalma Jun 22, 2023
1ceb08a
fix fail sender machine
MEPalma Jun 23, 2023
387016f
Merge branch 'master' into MEP-sfn-timeout
MEPalma Jun 23, 2023
51a9f84
Merge branch 'MEP-sfn-timeout' into MEP-sfn-taskfailure
MEPalma Jun 23, 2023
157993c
conflicts
MEPalma Jun 25, 2023
03ba9ce
conflicts, iterator in heartbeat_success machine
MEPalma Jun 25, 2023
497186c
conflicts
MEPalma Jun 26, 2023
d55ace6
update heartbeat snapshot tests
MEPalma Jun 26, 2023
44a83eb
base sfn support working
MEPalma Jun 28, 2023
2e3bb6e
input stringification
MEPalma Jun 28, 2023
e77df2b
sync happy path
MEPalma Jul 3, 2023
a73fe68
[]
MEPalma Jul 4, 2023
a90ecb8
timeout error types
MEPalma Jul 4, 2023
840a8a4
Merge branch 'master' into MEP-snf-heartbeat
MEPalma Jul 5, 2023
ad247a5
Merge branch 'MEP-snf-heartbeat' into MEP-sfn-sync-and-sfn
MEPalma Jul 5, 2023
525fae0
reworked exceptinos handling, fixes, tests
MEPalma Jul 5, 2023
7b85932
Merge branch 'master' into MEP-snf-heartbeat
MEPalma Jul 6, 2023
581f46f
cleanup
MEPalma Jul 6, 2023
b8d2526
Merge branch 'MEP-snf-heartbeat' into MEP-sfn-sync-and-sfn
MEPalma Jul 6, 2023
fc69033
Merge branch 'master' into MEP-sfn-sync-and-sfn
MEPalma Jul 6, 2023
0942505
Merge branch 'master' into MEP-sfn-sync-and-sfn
MEPalma Jul 7, 2023
9edad2d
connect_to in sqs
MEPalma Jul 13, 2023
562c236
Merge branch 'master' into MEP-sfn-sync-and-sfn
MEPalma Jul 13, 2023
e4985ee
Merge branch 'master' into MEP-sfn-sync-and-sfn
MEPalma Jul 14, 2023
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
Prev Previous commit
Next Next commit
update heartbeat snapshot tests
  • Loading branch information
MEPalma committed Jun 26, 2023
commit d55ace67af87f63accedad7e6a355e4f8da89d4d
42 changes: 21 additions & 21 deletions tests/integration/stepfunctions/v2/timeouts/test_heartbeats.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,18 @@
]
)
class TestHeartbeats:
@pytest.mark.skip_snapshot_verify(paths=["$..MD5OfMessageBody", "$..QueueUrl"])
@pytest.mark.skip_snapshot_verify(paths=["$..MD5OfMessageBody"])
def test_heartbeat_timeout(
self,
aws_client,
create_iam_role_for_sfn,
create_state_machine,
sqs_create_queue,
sqs_send_task_success_state_machine,
snapshot,
sfn_snapshot,
):
snapshot.add_transformer(snapshot.transform.sqs_api())
snapshot.add_transformer(
sfn_snapshot.add_transformer(sfn_snapshot.transform.sqs_api())
sfn_snapshot.add_transformer(
JsonpathTransformer(
jsonpath="$..TaskToken",
replacement="task_token",
Expand All @@ -45,8 +45,8 @@ def test_heartbeat_timeout(

queue_name = f"queue-{short_uid()}"
queue_url = sqs_create_queue(QueueName=queue_name)
snapshot.add_transformer(RegexTransformer(queue_url, "<sqs_queue_url>"))
snapshot.add_transformer(RegexTransformer(queue_name, "<sqs_queue_name>"))
sfn_snapshot.add_transformer(RegexTransformer(queue_url, "<sqs_queue_url>"))
sfn_snapshot.add_transformer(RegexTransformer(queue_name, "<sqs_queue_name>"))

template = TT.load_sfn_template(TT.SERVICE_SQS_SEND_AND_WAIT_FOR_TASK_TOKEN_WITH_HEARTBEAT)
definition = json.dumps(template)
Expand All @@ -57,23 +57,23 @@ def test_heartbeat_timeout(
aws_client.stepfunctions,
create_iam_role_for_sfn,
create_state_machine,
snapshot,
sfn_snapshot,
definition,
exec_input,
)

@pytest.mark.skip_snapshot_verify(paths=["$..MD5OfMessageBody", "$..QueueUrl"])
@pytest.mark.skip_snapshot_verify(paths=["$..MD5OfMessageBody"])
def test_heartbeat_path_timeout(
self,
aws_client,
create_iam_role_for_sfn,
create_state_machine,
sqs_create_queue,
sqs_send_task_success_state_machine,
snapshot,
sfn_snapshot,
):
snapshot.add_transformer(snapshot.transform.sqs_api())
snapshot.add_transformer(
sfn_snapshot.add_transformer(sfn_snapshot.transform.sqs_api())
sfn_snapshot.add_transformer(
JsonpathTransformer(
jsonpath="$..TaskToken",
replacement="task_token",
Expand All @@ -83,8 +83,8 @@ def test_heartbeat_path_timeout(

queue_name = f"queue-{short_uid()}"
queue_url = sqs_create_queue(QueueName=queue_name)
snapshot.add_transformer(RegexTransformer(queue_url, "<sqs_queue_url>"))
snapshot.add_transformer(RegexTransformer(queue_name, "<sqs_queue_name>"))
sfn_snapshot.add_transformer(RegexTransformer(queue_url, "<sqs_queue_url>"))
sfn_snapshot.add_transformer(RegexTransformer(queue_name, "<sqs_queue_name>"))

template = TT.load_sfn_template(
TT.SERVICE_SQS_SEND_AND_WAIT_FOR_TASK_TOKEN_WITH_HEARTBEAT_PATH
Expand All @@ -99,23 +99,23 @@ def test_heartbeat_path_timeout(
aws_client.stepfunctions,
create_iam_role_for_sfn,
create_state_machine,
snapshot,
sfn_snapshot,
definition,
exec_input,
)

@pytest.mark.skip_snapshot_verify(paths=["$..MD5OfMessageBody", "$..QueueUrl"])
@pytest.mark.skip_snapshot_verify(paths=["$..MD5OfMessageBody"])
def test_heartbeat_no_timeout(
self,
aws_client,
create_iam_role_for_sfn,
create_state_machine,
sqs_create_queue,
sqs_send_task_success_state_machine,
snapshot,
sfn_snapshot,
):
snapshot.add_transformer(snapshot.transform.sqs_api())
snapshot.add_transformer(
sfn_snapshot.add_transformer(sfn_snapshot.transform.sqs_api())
sfn_snapshot.add_transformer(
JsonpathTransformer(
jsonpath="$..TaskToken",
replacement="task_token",
Expand All @@ -125,8 +125,8 @@ def test_heartbeat_no_timeout(

queue_name = f"queue-{short_uid()}"
queue_url = sqs_create_queue(QueueName=queue_name)
snapshot.add_transformer(RegexTransformer(queue_url, "<sqs_queue_url>"))
snapshot.add_transformer(RegexTransformer(queue_name, "<sqs_queue_name>"))
sfn_snapshot.add_transformer(RegexTransformer(queue_url, "<sqs_queue_url>"))
sfn_snapshot.add_transformer(RegexTransformer(queue_name, "<sqs_queue_name>"))

template = TT.load_sfn_template(TT.SERVICE_SQS_SEND_AND_WAIT_FOR_TASK_TOKEN_WITH_HEARTBEAT)
del template["States"]["SendMessageWithWait"]["TimeoutSeconds"]
Expand All @@ -138,7 +138,7 @@ def test_heartbeat_no_timeout(
aws_client.stepfunctions,
create_iam_role_for_sfn,
create_state_machine,
snapshot,
sfn_snapshot,
definition,
exec_input,
)
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"tests/integration/stepfunctions/v2/timeouts/test_heartbeats.py::TestHeartbeats::test_heartbeat_timeout": {
"recorded-date": "30-05-2023, 21:53:50",
"recorded-date": "26-06-2023, 09:12:29",
"recorded-content": {
"get_execution_history": {
"events": [
Expand Down Expand Up @@ -71,7 +71,7 @@
"previousEventId": 4,
"taskSubmittedEventDetails": {
"output": {
"MD5OfMessageBody": "a49c7d1b1fbe7c967e6c590d9c2fb877",
"MD5OfMessageBody": "fb73571f092a3f4109111810ab3831d8",
"MessageId": "<uuid:1>",
"SdkHttpMetadata": {
"AllHttpHeaders": {
Expand All @@ -81,17 +81,15 @@
"Content-Length": [
"378"
],
"Date": [
"Tue, 30 May 2023 19:53:48 GMT"
],
"Date": "date",
"Content-Type": [
"text/xml"
]
},
"HttpHeaders": {
"Content-Length": "378",
"Content-Type": "text/xml",
"Date": "Tue, 30 May 2023 19:53:48 GMT",
"Date": "date",
"x-amzn-RequestId": "<uuid:2>"
},
"HttpStatusCode": 200
Expand Down Expand Up @@ -137,16 +135,17 @@
}
}
},
"tests/integration/stepfunctions/v2/timeouts/test_heartbeats.py::TestHeartbeats::test_heartbeat_no_timeout": {
"recorded-date": "30-05-2023, 21:58:13",
"tests/integration/stepfunctions/v2/timeouts/test_heartbeats.py::TestHeartbeats::test_heartbeat_path_timeout": {
"recorded-date": "26-06-2023, 09:12:45",
"recorded-content": {
"get_execution_history": {
"events": [
{
"executionStartedEventDetails": {
"input": {
"QueueUrl": "<sqs_queue_url>",
"Message": "test_message_txt"
"Message": "test_message_txt",
"HeartbeatSecondsPath": 1
},
"inputDetails": {
"truncated": false
Expand All @@ -164,7 +163,8 @@
"stateEnteredEventDetails": {
"input": {
"QueueUrl": "<sqs_queue_url>",
"Message": "test_message_txt"
"Message": "test_message_txt",
"HeartbeatSecondsPath": 1
},
"inputDetails": {
"truncated": false
Expand All @@ -188,7 +188,8 @@
},
"region": "<region>",
"resource": "sendMessage.waitForTaskToken",
"resourceType": "sqs"
"resourceType": "sqs",
"timeoutInSeconds": 600
},
"timestamp": "timestamp",
"type": "TaskScheduled"
Expand All @@ -208,7 +209,7 @@
"previousEventId": 4,
"taskSubmittedEventDetails": {
"output": {
"MD5OfMessageBody": "3dd59e6b2c2179516b424b1fc897d9e6",
"MD5OfMessageBody": "25de2160ee3d3f24143ab58c6d94d338",
"MessageId": "<uuid:1>",
"SdkHttpMetadata": {
"AllHttpHeaders": {
Expand All @@ -218,17 +219,15 @@
"Content-Length": [
"378"
],
"Date": [
"Tue, 30 May 2023 19:58:12 GMT"
],
"Date": "date",
"Content-Type": [
"text/xml"
]
},
"HttpHeaders": {
"Content-Length": "378",
"Content-Type": "text/xml",
"Date": "Tue, 30 May 2023 19:58:12 GMT",
"Date": "date",
"x-amzn-RequestId": "<uuid:2>"
},
"HttpStatusCode": 200
Expand Down Expand Up @@ -274,17 +273,16 @@
}
}
},
"tests/integration/stepfunctions/v2/timeouts/test_heartbeats.py::TestHeartbeats::test_heartbeat_path_timeout": {
"recorded-date": "02-06-2023, 14:21:14",
"tests/integration/stepfunctions/v2/timeouts/test_heartbeats.py::TestHeartbeats::test_heartbeat_no_timeout": {
"recorded-date": "26-06-2023, 09:13:01",
"recorded-content": {
"get_execution_history": {
"events": [
{
"executionStartedEventDetails": {
"input": {
"QueueUrl": "<sqs_queue_url>",
"Message": "test_message_txt",
"HeartbeatSecondsPath": 1
"Message": "test_message_txt"
},
"inputDetails": {
"truncated": false
Expand All @@ -302,8 +300,7 @@
"stateEnteredEventDetails": {
"input": {
"QueueUrl": "<sqs_queue_url>",
"Message": "test_message_txt",
"HeartbeatSecondsPath": 1
"Message": "test_message_txt"
},
"inputDetails": {
"truncated": false
Expand All @@ -327,8 +324,7 @@
},
"region": "<region>",
"resource": "sendMessage.waitForTaskToken",
"resourceType": "sqs",
"timeoutInSeconds": 600
"resourceType": "sqs"
},
"timestamp": "timestamp",
"type": "TaskScheduled"
Expand All @@ -348,7 +344,7 @@
"previousEventId": 4,
"taskSubmittedEventDetails": {
"output": {
"MD5OfMessageBody": "5914c51a0d80dca647338f3b5cc6c0e2",
"MD5OfMessageBody": "50275e94a825e3cea0c549f06c752088",
"MessageId": "<uuid:1>",
"SdkHttpMetadata": {
"AllHttpHeaders": {
Expand All @@ -358,17 +354,15 @@
"Content-Length": [
"378"
],
"Date": [
"Fri, 02 Jun 2023 12:21:12 GMT"
],
"Date": "date",
"Content-Type": [
"text/xml"
]
},
"HttpHeaders": {
"Content-Length": "378",
"Content-Type": "text/xml",
"Date": "Fri, 02 Jun 2023 12:21:12 GMT",
"Date": "date",
"x-amzn-RequestId": "<uuid:2>"
},
"HttpStatusCode": 200
Expand Down
0