@@ -33,6 +33,7 @@ def test_execution_init():
3333 execution_name = "test-execution" ,
3434 execution_timeout_seconds = 300 ,
3535 execution_retention_period_days = 7 ,
36+ invocation_id = "test-invocation-id" ,
3637 )
3738 operations = []
3839
@@ -61,11 +62,12 @@ def test_execution_new(mock_uuid4):
6162 execution_name = "test-execution" ,
6263 execution_timeout_seconds = 300 ,
6364 execution_retention_period_days = 7 ,
65+ invocation_id = "test-invocation-id-1234" ,
6466 )
6567
6668 execution = Execution .new (start_input )
6769
68- assert execution .durable_execution_arn == str (mock_uuid )
70+ assert execution .durable_execution_arn == str (mock_uuid ) + "/test-invocation-id-1234"
6971 assert execution .start_input == start_input
7072 assert execution .operations == []
7173
@@ -130,6 +132,7 @@ def test_get_operation_execution_started_not_started():
130132 execution_name = "test-execution" ,
131133 execution_timeout_seconds = 300 ,
132134 execution_retention_period_days = 7 ,
135+ invocation_id = "test-invocation-id" ,
133136 )
134137 execution = Execution ("test-arn" , start_input , [])
135138
@@ -146,6 +149,7 @@ def test_get_new_checkpoint_token():
146149 execution_name = "test-execution" ,
147150 execution_timeout_seconds = 300 ,
148151 execution_retention_period_days = 7 ,
152+ invocation_id = "invocation-id" ,
149153 )
150154 execution = Execution ("test-arn" , start_input , [])
151155
@@ -167,6 +171,7 @@ def test_get_navigable_operations():
167171 execution_name = "test-execution" ,
168172 execution_timeout_seconds = 300 ,
169173 execution_retention_period_days = 7 ,
174+ invocation_id = "test-invocation-id" ,
170175 )
171176 operations = [
172177 Operation (
@@ -194,6 +199,7 @@ def test_get_assertable_operations():
194199 execution_name = "test-execution" ,
195200 execution_timeout_seconds = 300 ,
196201 execution_retention_period_days = 7 ,
202+ invocation_id = "test-invocation-id" ,
197203 )
198204 execution_op = Operation (
199205 operation_id = "exec-op" ,
@@ -229,6 +235,7 @@ def test_has_pending_operations_with_pending_step():
229235 execution_name = "test-execution" ,
230236 execution_timeout_seconds = 300 ,
231237 execution_retention_period_days = 7 ,
238+ invocation_id = "test-invocation-id" ,
232239 )
233240 operations = [
234241 Operation (
@@ -256,6 +263,7 @@ def test_has_pending_operations_with_started_wait():
256263 execution_name = "test-execution" ,
257264 execution_timeout_seconds = 300 ,
258265 execution_retention_period_days = 7 ,
266+ invocation_id = "test-invocation-id" ,
259267 )
260268 operations = [
261269 Operation (
@@ -283,6 +291,7 @@ def test_has_pending_operations_with_started_callback():
283291 execution_name = "test-execution" ,
284292 execution_timeout_seconds = 300 ,
285293 execution_retention_period_days = 7 ,
294+ invocation_id = "test-invocation-id" ,
286295 )
287296 operations = [
288297 Operation (
@@ -310,6 +319,7 @@ def test_has_pending_operations_with_started_invoke():
310319 execution_name = "test-execution" ,
311320 execution_timeout_seconds = 300 ,
312321 execution_retention_period_days = 7 ,
322+ invocation_id = "test-invocation-id" ,
313323 )
314324 operations = [
315325 Operation (
@@ -337,6 +347,7 @@ def test_has_pending_operations_no_pending():
337347 execution_name = "test-execution" ,
338348 execution_timeout_seconds = 300 ,
339349 execution_retention_period_days = 7 ,
350+ invocation_id = "test-invocation-id" ,
340351 )
341352 operations = [
342353 Operation (
@@ -364,6 +375,7 @@ def test_complete_success_with_string_result():
364375 execution_name = "test-execution" ,
365376 execution_timeout_seconds = 300 ,
366377 execution_retention_period_days = 7 ,
378+ invocation_id = "test-invocation-id" ,
367379 )
368380 execution = Execution ("test-arn" , start_input , [Mock ()])
369381
@@ -383,6 +395,7 @@ def test_complete_success_with_none_result():
383395 execution_name = "test-execution" ,
384396 execution_timeout_seconds = 300 ,
385397 execution_retention_period_days = 7 ,
398+ invocation_id = "test-invocation-id" ,
386399 )
387400 execution = Execution ("test-arn" , start_input , [Mock ()])
388401
@@ -402,6 +415,7 @@ def test_complete_fail():
402415 execution_name = "test-execution" ,
403416 execution_timeout_seconds = 300 ,
404417 execution_retention_period_days = 7 ,
418+ invocation_id = "test-invocation-id" ,
405419 )
406420 execution = Execution ("test-arn" , start_input , [Mock ()])
407421 error = ErrorObject .from_message ("Test error message" )
@@ -422,6 +436,7 @@ def test_find_operation_exists():
422436 execution_name = "test-execution" ,
423437 execution_timeout_seconds = 300 ,
424438 execution_retention_period_days = 7 ,
439+ invocation_id = "test-invocation-id" ,
425440 )
426441 operation = Operation (
427442 operation_id = "test-op-id" ,
@@ -448,6 +463,7 @@ def test_find_operation_not_exists():
448463 execution_name = "test-execution" ,
449464 execution_timeout_seconds = 300 ,
450465 execution_retention_period_days = 7 ,
466+ invocation_id = "test-invocation-id" ,
451467 )
452468 execution = Execution ("test-arn" , start_input , [])
453469
@@ -470,6 +486,7 @@ def test_complete_wait_success(mock_datetime):
470486 execution_name = "test-execution" ,
471487 execution_timeout_seconds = 300 ,
472488 execution_retention_period_days = 7 ,
489+ invocation_id = "test-invocation-id" ,
473490 )
474491 operation = Operation (
475492 operation_id = "wait-op-id" ,
@@ -498,6 +515,7 @@ def test_complete_wait_wrong_status():
498515 execution_name = "test-execution" ,
499516 execution_timeout_seconds = 300 ,
500517 execution_retention_period_days = 7 ,
518+ invocation_id = "test-invocation-id" ,
501519 )
502520 operation = Operation (
503521 operation_id = "wait-op-id" ,
@@ -524,6 +542,7 @@ def test_complete_wait_wrong_type():
524542 execution_name = "test-execution" ,
525543 execution_timeout_seconds = 300 ,
526544 execution_retention_period_days = 7 ,
545+ invocation_id = "test-invocation-id" ,
527546 )
528547 operation = Operation (
529548 operation_id = "step-op-id" ,
@@ -548,6 +567,7 @@ def test_complete_retry_success():
548567 execution_name = "test-execution" ,
549568 execution_timeout_seconds = 300 ,
550569 execution_retention_period_days = 7 ,
570+ invocation_id = "test-invocation-id" ,
551571 )
552572 step_details = StepDetails (
553573 next_attempt_timestamp = str (datetime .now (timezone .utc )),
@@ -581,6 +601,7 @@ def test_complete_retry_no_step_details():
581601 execution_name = "test-execution" ,
582602 execution_timeout_seconds = 300 ,
583603 execution_retention_period_days = 7 ,
604+ invocation_id = "test-invocation-id" ,
584605 )
585606 operation = Operation (
586607 operation_id = "step-op-id" ,
@@ -608,6 +629,7 @@ def test_complete_retry_wrong_status():
608629 execution_name = "test-execution" ,
609630 execution_timeout_seconds = 300 ,
610631 execution_retention_period_days = 7 ,
632+ invocation_id = "test-invocation-id" ,
611633 )
612634 operation = Operation (
613635 operation_id = "step-op-id" ,
@@ -634,6 +656,7 @@ def test_complete_retry_wrong_type():
634656 execution_name = "test-execution" ,
635657 execution_timeout_seconds = 300 ,
636658 execution_retention_period_days = 7 ,
659+ invocation_id = "test-invocation-id" ,
637660 )
638661 operation = Operation (
639662 operation_id = "wait-op-id" ,
@@ -658,6 +681,7 @@ def test_status_running():
658681 execution_name = "test-execution" ,
659682 execution_timeout_seconds = 300 ,
660683 execution_retention_period_days = 7 ,
684+ invocation_id = "test-invocation-id" ,
661685 )
662686 execution = Execution ("test-arn" , start_input , [])
663687
@@ -673,6 +697,7 @@ def test_status_succeeded():
673697 execution_name = "test-execution" ,
674698 execution_timeout_seconds = 300 ,
675699 execution_retention_period_days = 7 ,
700+ invocation_id = "test-invocation-id" ,
676701 )
677702 execution = Execution ("test-arn" , start_input , [Mock ()])
678703 execution .complete_success ("success result" )
@@ -689,6 +714,7 @@ def test_status_failed():
689714 execution_name = "test-execution" ,
690715 execution_timeout_seconds = 300 ,
691716 execution_retention_period_days = 7 ,
717+ invocation_id = "test-invocation-id" ,
692718 )
693719 execution = Execution ("test-arn" , start_input , [Mock ()])
694720 error = ErrorObject .from_message ("Test error" )
@@ -706,6 +732,7 @@ def test_status_timed_out():
706732 execution_name = "test-execution" ,
707733 execution_timeout_seconds = 300 ,
708734 execution_retention_period_days = 7 ,
735+ invocation_id = "invocation-id" ,
709736 )
710737 execution = Execution ("test-arn" , start_input , [Mock ()])
711738 error = ErrorObject (
@@ -725,6 +752,7 @@ def test_status_stopped():
725752 execution_name = "test-execution" ,
726753 execution_timeout_seconds = 300 ,
727754 execution_retention_period_days = 7 ,
755+ invocation_id = "invocation-id" ,
728756 )
729757 execution = Execution ("test-arn" , start_input , [Mock ()])
730758 error = ErrorObject (
@@ -744,6 +772,7 @@ def test_status_no_result():
744772 execution_name = "test-execution" ,
745773 execution_timeout_seconds = 300 ,
746774 execution_retention_period_days = 7 ,
775+ invocation_id = "invocation-id" ,
747776 )
748777 execution = Execution ("test-arn" , start_input , [])
749778 execution .is_complete = True
0 commit comments