Skip to content

Commit 2bd9e42

Browse files
committed
ci: add remaining history tests
1 parent 6ddce5d commit 2bd9e42

File tree

39 files changed

+4019
-32
lines changed

39 files changed

+4019
-32
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
[
2+
{
3+
"EventType": "ExecutionStarted",
4+
"EventId": 1,
5+
"Id": "1fa767a9-4af5-4dd0-99e0-631de26ca1da",
6+
"EventTimestamp": "2025-12-18T21:47:14.081Z",
7+
"ExecutionStartedDetails": {
8+
"Input": {
9+
"Payload": "{\"shouldCatchError\":false}"
10+
}
11+
}
12+
},
13+
{
14+
"EventType": "CallbackStarted",
15+
"SubType": "Callback",
16+
"EventId": 2,
17+
"Id": "c4ca4238a0b92382",
18+
"Name": "failing-operation",
19+
"EventTimestamp": "2025-12-18T21:47:14.087Z",
20+
"CallbackStartedDetails": {
21+
"CallbackId": "eyJleGVjdXRpb25JZCI6ImZmYzczMDJkLTQzZDAtNGEzNS1hNDBjLWEyOWZmNDY5MTI0MCIsIm9wZXJhdGlvbklkIjoiYzRjYTQyMzhhMGI5MjM4MiIsInRva2VuIjoiYWVjZDg5NTktNjJjMS00NTgxLTk1ODctMmQyYjQzZjM1MmMzIn0=",
22+
"Input": {}
23+
}
24+
},
25+
{
26+
"EventType": "CallbackFailed",
27+
"SubType": "Callback",
28+
"EventId": 3,
29+
"Id": "c4ca4238a0b92382",
30+
"Name": "failing-operation",
31+
"EventTimestamp": "2025-12-18T21:47:14.089Z",
32+
"CallbackFailedDetails": {
33+
"Error": {
34+
"Payload": {
35+
"ErrorMessage": "External API failure",
36+
"ErrorType": "APIException"
37+
}
38+
}
39+
}
40+
},
41+
{
42+
"EventType": "InvocationCompleted",
43+
"EventId": 4,
44+
"EventTimestamp": "2025-12-18T21:47:14.142Z",
45+
"InvocationCompletedDetails": {
46+
"StartTimestamp": "2025-12-18T21:47:14.081Z",
47+
"EndTimestamp": "2025-12-18T21:47:14.142Z",
48+
"Error": {},
49+
"RequestId": "7057c988-1de9-4aae-8af5-46fe656d0ade"
50+
}
51+
},
52+
{
53+
"EventType": "InvocationCompleted",
54+
"EventId": 5,
55+
"EventTimestamp": "2025-12-18T21:47:14.148Z",
56+
"InvocationCompletedDetails": {
57+
"StartTimestamp": "2025-12-18T21:47:14.146Z",
58+
"EndTimestamp": "2025-12-18T21:47:14.148Z",
59+
"Error": {
60+
"Payload": {
61+
"ErrorType": "CallbackError",
62+
"ErrorMessage": "External API failure"
63+
}
64+
},
65+
"RequestId": "824da5e0-6ac8-4e3d-b462-0009d7391a80"
66+
}
67+
},
68+
{
69+
"EventType": "ExecutionFailed",
70+
"EventId": 6,
71+
"Id": "1fa767a9-4af5-4dd0-99e0-631de26ca1da",
72+
"EventTimestamp": "2025-12-18T21:47:14.148Z",
73+
"ExecutionFailedDetails": {
74+
"Error": {
75+
"Payload": {
76+
"ErrorType": "CallbackError",
77+
"ErrorMessage": "External API failure"
78+
}
79+
}
80+
}
81+
}
82+
]

packages/aws-durable-execution-sdk-js-examples/src/examples/create-callback/failures/create-callback-failures.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { createTests } from "../../../utils/test-helper";
88
createTests({
99
handler,
1010
invocationType: InvocationType.Event,
11-
tests: (runner) => {
11+
tests: (runner, { assertEventSignatures }) => {
1212
it("should handle callback operations with failure", async () => {
1313
const callbackOperation = runner.getOperation("failing-operation");
1414

@@ -32,6 +32,8 @@ createTests({
3232
errorType: "CallbackError",
3333
stackTrace: undefined,
3434
});
35+
36+
assertEventSignatures(result);
3537
});
3638
},
3739
});
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
[
2+
{
3+
"EventType": "ExecutionStarted",
4+
"EventId": 1,
5+
"Id": "8196cab6-0731-48d8-8d01-2e8640cfbec1",
6+
"EventTimestamp": "2025-12-18T21:47:02.807Z",
7+
"ExecutionStartedDetails": {
8+
"Input": {
9+
"Payload": "{\"isCloud\":false}"
10+
}
11+
}
12+
},
13+
{
14+
"EventType": "CallbackStarted",
15+
"SubType": "Callback",
16+
"EventId": 2,
17+
"Id": "c4ca4238a0b92382",
18+
"Name": "long-running-task",
19+
"EventTimestamp": "2025-12-18T21:47:02.811Z",
20+
"CallbackStartedDetails": {
21+
"CallbackId": "eyJleGVjdXRpb25JZCI6IjU5NWM5NjNiLWUwMGEtNDEyNi1iMWRmLTNhMzNmYWEwZmI0YSIsIm9wZXJhdGlvbklkIjoiYzRjYTQyMzhhMGI5MjM4MiIsInRva2VuIjoiNzU4MTYxY2UtZDA3Yi00N2M1LWE4NDYtNzZmNjgxMDg2ZDg0In0=",
22+
"HeartbeatTimeout": 1,
23+
"Input": {}
24+
}
25+
},
26+
{
27+
"EventType": "InvocationCompleted",
28+
"EventId": 3,
29+
"EventTimestamp": "2025-12-18T21:47:02.863Z",
30+
"InvocationCompletedDetails": {
31+
"StartTimestamp": "2025-12-18T21:47:02.806Z",
32+
"EndTimestamp": "2025-12-18T21:47:02.863Z",
33+
"Error": {},
34+
"RequestId": "1aa7b2ab-68c0-44a6-92a9-4876ee2963f3"
35+
}
36+
},
37+
{
38+
"EventType": "CallbackSucceeded",
39+
"SubType": "Callback",
40+
"EventId": 4,
41+
"Id": "c4ca4238a0b92382",
42+
"Name": "long-running-task",
43+
"EventTimestamp": "2025-12-18T21:47:04.016Z",
44+
"CallbackSucceededDetails": {
45+
"Result": {
46+
"Payload": "{\"processed\":1000,\"status\":\"completed\"}"
47+
}
48+
}
49+
},
50+
{
51+
"EventType": "InvocationCompleted",
52+
"EventId": 5,
53+
"EventTimestamp": "2025-12-18T21:47:04.018Z",
54+
"InvocationCompletedDetails": {
55+
"StartTimestamp": "2025-12-18T21:47:04.017Z",
56+
"EndTimestamp": "2025-12-18T21:47:04.018Z",
57+
"Error": {},
58+
"RequestId": "f6c655d4-c681-475c-8e14-17c62257cd6c"
59+
}
60+
},
61+
{
62+
"EventType": "ExecutionSucceeded",
63+
"EventId": 6,
64+
"Id": "8196cab6-0731-48d8-8d01-2e8640cfbec1",
65+
"EventTimestamp": "2025-12-18T21:47:04.018Z",
66+
"ExecutionSucceededDetails": {
67+
"Result": {
68+
"Payload": "{\"longTaskResult\":\"{\\\"processed\\\":1000,\\\"status\\\":\\\"completed\\\"}\"}"
69+
}
70+
}
71+
}
72+
]

packages/aws-durable-execution-sdk-js-examples/src/examples/create-callback/heartbeat/create-callback-heartbeat.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { InvocationType } from "@aws-sdk/client-lambda";
55
createTests({
66
handler,
77
invocationType: InvocationType.Event,
8-
tests: (runner, { isCloud }) => {
8+
tests: (runner, { isCloud, assertEventSignatures }) => {
99
it("should handle callback heartbeats during long-running tasks", async () => {
1010
const callbackOperation = runner.getOperation("long-running-task");
1111

@@ -37,6 +37,8 @@ createTests({
3737
expect(result.getResult()).toEqual({
3838
longTaskResult: callbackResult,
3939
});
40+
41+
assertEventSignatures(result);
4042
});
4143
},
4244
});
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
[
2+
{
3+
"EventType": "ExecutionStarted",
4+
"EventId": 1,
5+
"Id": "2cc413a6-2fe9-42ea-b57c-a2a82492121e",
6+
"EventTimestamp": "2025-12-18T21:47:12.729Z",
7+
"ExecutionStartedDetails": {
8+
"Input": {
9+
"Payload": "{}"
10+
}
11+
}
12+
},
13+
{
14+
"EventType": "CallbackStarted",
15+
"SubType": "Callback",
16+
"EventId": 2,
17+
"Id": "c4ca4238a0b92382",
18+
"Name": "custom-serdes-callback",
19+
"EventTimestamp": "2025-12-18T21:47:12.733Z",
20+
"CallbackStartedDetails": {
21+
"CallbackId": "eyJleGVjdXRpb25JZCI6IjA5NWI0MjE4LTJhMjEtNDUyNy05MGRmLWUzNDE1MzI0ZmMyOCIsIm9wZXJhdGlvbklkIjoiYzRjYTQyMzhhMGI5MjM4MiIsInRva2VuIjoiOWU2YWZkNTEtOTNjOC00ZjY2LTg2ZDgtYzI4MjAwZGM5NWYyIn0=",
22+
"Timeout": 300,
23+
"Input": {}
24+
}
25+
},
26+
{
27+
"EventType": "CallbackSucceeded",
28+
"SubType": "Callback",
29+
"EventId": 3,
30+
"Id": "c4ca4238a0b92382",
31+
"Name": "custom-serdes-callback",
32+
"EventTimestamp": "2025-12-18T21:47:12.734Z",
33+
"CallbackSucceededDetails": {
34+
"Result": {
35+
"Payload": "{\"id\":42,\"message\":\"Hello World\",\"timestamp\":\"2025-01-01T00:00:00.000Z\"}"
36+
}
37+
}
38+
},
39+
{
40+
"EventType": "InvocationCompleted",
41+
"EventId": 4,
42+
"EventTimestamp": "2025-12-18T21:47:12.785Z",
43+
"InvocationCompletedDetails": {
44+
"StartTimestamp": "2025-12-18T21:47:12.729Z",
45+
"EndTimestamp": "2025-12-18T21:47:12.785Z",
46+
"Error": {},
47+
"RequestId": "7dd3a892-47a5-4a71-9ad4-373104b5e7ac"
48+
}
49+
},
50+
{
51+
"EventType": "InvocationCompleted",
52+
"EventId": 5,
53+
"EventTimestamp": "2025-12-18T21:47:12.787Z",
54+
"InvocationCompletedDetails": {
55+
"StartTimestamp": "2025-12-18T21:47:12.786Z",
56+
"EndTimestamp": "2025-12-18T21:47:12.787Z",
57+
"Error": {},
58+
"RequestId": "5de442ad-c6ed-4641-bb7f-2bf814680b9f"
59+
}
60+
},
61+
{
62+
"EventType": "ExecutionSucceeded",
63+
"EventId": 6,
64+
"Id": "2cc413a6-2fe9-42ea-b57c-a2a82492121e",
65+
"EventTimestamp": "2025-12-18T21:47:12.787Z",
66+
"ExecutionSucceededDetails": {
67+
"Result": {
68+
"Payload": "{\"receivedData\":{\"id\":42,\"message\":\"Hello World\",\"timestamp\":\"2025-01-01T00:00:00.000Z\"},\"isDateObject\":true}"
69+
}
70+
}
71+
}
72+
]

packages/aws-durable-execution-sdk-js-examples/src/examples/create-callback/serdes/create-callback-serdes.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ const customSerdes = {
3030
createTests({
3131
handler,
3232
invocationType: InvocationType.Event,
33-
tests: (runner) => {
33+
tests: (runner, { assertEventSignatures }) => {
3434
it("should handle callback operations with custom serdes", async () => {
3535
const callbackOperation = runner.getOperation("custom-serdes-callback");
3636
const executionPromise = runner.run();
@@ -58,6 +58,8 @@ createTests({
5858
}),
5959
),
6060
);
61+
62+
assertEventSignatures(result);
6163
});
6264
},
6365
});
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
[
2+
{
3+
"EventType": "ExecutionStarted",
4+
"EventId": 1,
5+
"Id": "a457c641-16c5-453f-8b30-1e69cc1360bf",
6+
"EventTimestamp": "2025-12-18T21:46:55.871Z",
7+
"ExecutionStartedDetails": {
8+
"Input": {
9+
"Payload": "{\"timeoutType\":\"heartbeat\"}"
10+
}
11+
}
12+
},
13+
{
14+
"EventType": "CallbackStarted",
15+
"SubType": "Callback",
16+
"EventId": 2,
17+
"Id": "c4ca4238a0b92382",
18+
"Name": "long-running-task",
19+
"EventTimestamp": "2025-12-18T21:46:55.877Z",
20+
"CallbackStartedDetails": {
21+
"CallbackId": "eyJleGVjdXRpb25JZCI6IjBhMWM3ZmI1LTZmMDEtNDc2OC1hMTk0LWMwZmQ4ZTgwN2RkZiIsIm9wZXJhdGlvbklkIjoiYzRjYTQyMzhhMGI5MjM4MiIsInRva2VuIjoiNGUwYTNiYWEtNzlhMC00ZWQ2LTk4NDktZjQzMThjMDdmMmJhIn0=",
22+
"HeartbeatTimeout": 1,
23+
"Input": {}
24+
}
25+
},
26+
{
27+
"EventType": "InvocationCompleted",
28+
"EventId": 3,
29+
"EventTimestamp": "2025-12-18T21:46:55.930Z",
30+
"InvocationCompletedDetails": {
31+
"StartTimestamp": "2025-12-18T21:46:55.871Z",
32+
"EndTimestamp": "2025-12-18T21:46:55.930Z",
33+
"Error": {},
34+
"RequestId": "e737ab46-8a75-4224-a14f-7565e8b6024a"
35+
}
36+
},
37+
{
38+
"EventType": "CallbackTimedOut",
39+
"SubType": "Callback",
40+
"EventId": 4,
41+
"Id": "c4ca4238a0b92382",
42+
"Name": "long-running-task",
43+
"EventTimestamp": "2025-12-18T21:46:56.877Z",
44+
"CallbackTimedOutDetails": {
45+
"Error": {
46+
"Payload": {
47+
"ErrorMessage": "Callback timed out on heartbeat"
48+
}
49+
}
50+
}
51+
},
52+
{
53+
"EventType": "InvocationCompleted",
54+
"EventId": 5,
55+
"EventTimestamp": "2025-12-18T21:46:56.880Z",
56+
"InvocationCompletedDetails": {
57+
"StartTimestamp": "2025-12-18T21:46:56.879Z",
58+
"EndTimestamp": "2025-12-18T21:46:56.880Z",
59+
"Error": {
60+
"Payload": {
61+
"ErrorType": "CallbackError",
62+
"ErrorMessage": "Callback timed out on heartbeat"
63+
}
64+
},
65+
"RequestId": "0c1fc18c-ecda-4398-b922-52427940f47b"
66+
}
67+
},
68+
{
69+
"EventType": "ExecutionFailed",
70+
"EventId": 6,
71+
"Id": "a457c641-16c5-453f-8b30-1e69cc1360bf",
72+
"EventTimestamp": "2025-12-18T21:46:56.880Z",
73+
"ExecutionFailedDetails": {
74+
"Error": {
75+
"Payload": {
76+
"ErrorType": "CallbackError",
77+
"ErrorMessage": "Callback timed out on heartbeat"
78+
}
79+
}
80+
}
81+
}
82+
]

packages/aws-durable-execution-sdk-js-examples/src/examples/create-callback/timeout/create-callback-timeout.test.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { createTests } from "../../../utils/test-helper";
33

44
createTests({
55
handler,
6-
tests: (runner) => {
6+
tests: (runner, { assertEventSignatures }) => {
77
it("should time out if there are no callback heartbeats", async () => {
88
const result = await runner.run({
99
payload: { timeoutType: "heartbeat" },
@@ -15,6 +15,8 @@ createTests({
1515
errorType: "CallbackError",
1616
stackTrace: undefined,
1717
});
18+
19+
assertEventSignatures(result);
1820
});
1921

2022
it("should time out if callback times out", async () => {
@@ -28,6 +30,8 @@ createTests({
2830
errorType: "CallbackError",
2931
stackTrace: undefined,
3032
});
33+
34+
assertEventSignatures(result);
3135
});
3236
},
3337
});

0 commit comments

Comments
 (0)