Skip to content

Commit efcad5c

Browse files
committed
update tests to skip InvocationCompleted when skipTime is enabled
1 parent efa0648 commit efcad5c

File tree

48 files changed

+130
-108
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+130
-108
lines changed

packages/aws-durable-execution-sdk-js-examples/src/examples/block-example/block-example.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import { OperationType } from "@aws/durable-execution-sdk-js-testing";
22
import { handler } from "./block-example";
33
import historyEvents from "./block-example.history.json";
4-
import { assertEventSignatures, createTests } from "../../utils/test-helper";
4+
import { createTests } from "../../utils/test-helper";
55

66
createTests({
77
name: "block-example test",
88
functionName: "block-example",
99
handler,
10-
tests: (runner) => {
10+
tests: (runner, { assertEventSignatures }) => {
1111
it("should execute nested child contexts with proper checkpointing", async () => {
1212
const execution = await runner.run();
1313

packages/aws-durable-execution-sdk-js-examples/src/examples/comprehensive-operations/comprehensive-operations.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import { handler } from "./comprehensive-operations";
22
import historyEvents from "./comprehensive-operations.history.json";
3-
import { assertEventSignatures, createTests } from "../../utils/test-helper";
3+
import { createTests } from "../../utils/test-helper";
44

55
createTests({
66
name: "comprehensive-operations test",
77
functionName: "comprehensive-operations",
88
handler,
9-
tests: (runner) => {
9+
tests: (runner, { assertEventSignatures }) => {
1010
it("should execute all operations successfully", async () => {
1111
const execution = await runner.run();
1212
const result = execution.getResult() as any;

packages/aws-durable-execution-sdk-js-examples/src/examples/concurrent/operations/concurrent-operations.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { handler } from "./concurrent-operations";
22
import historyEvents from "./concurrent-operations.history.json";
3-
import { assertEventSignatures, createTests } from "../../../utils/test-helper";
3+
import { createTests } from "../../../utils/test-helper";
44

55
createTests({
66
name: "concurrent-operations test",
@@ -9,7 +9,7 @@ createTests({
99
skipTime: false,
1010
},
1111
handler,
12-
tests: (runner) => {
12+
tests: (runner, { assertEventSignatures }) => {
1313
it("should handle promise.all correctly", async () => {
1414
const execution = await runner.run();
1515

packages/aws-durable-execution-sdk-js-examples/src/examples/concurrent/wait/concurrent-wait.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { handler } from "./concurrent-wait";
22
import historyEvents from "./concurrent-wait.history.json";
3-
import { assertEventSignatures, createTests } from "../../../utils/test-helper";
3+
import { createTests } from "../../../utils/test-helper";
44

55
createTests({
66
name: "concurrent-wait test",
@@ -9,7 +9,7 @@ createTests({
99
skipTime: false,
1010
},
1111
handler,
12-
tests: (runner) => {
12+
tests: (runner, { assertEventSignatures }) => {
1313
it("should complete all waits and wait for the max duration", async () => {
1414
const execution = await runner.run();
1515

packages/aws-durable-execution-sdk-js-examples/src/examples/context-validation/parent-context-in-child/parent-context-in-child.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { handler } from "./parent-context-in-child";
22
import historyEvents from "./parent-context-in-child.history.json";
3-
import { assertEventSignatures, createTests } from "../../../utils/test-helper";
3+
import { createTests } from "../../../utils/test-helper";
44

55
// Set shorter timeout for context validation tests since they should fail quickly
66
jest.setTimeout(5000);
@@ -9,7 +9,7 @@ createTests({
99
name: "context validation - parent context in child error",
1010
functionName: "parent-context-in-child",
1111
handler,
12-
tests: (runner) => {
12+
tests: (runner, { assertEventSignatures }) => {
1313
it("should fail when using parent context directly in child", async () => {
1414
const execution = await runner.run();
1515

packages/aws-durable-execution-sdk-js-examples/src/examples/context-validation/parent-context-in-step/parent-context-in-step.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { handler } from "./parent-context-in-step";
22
import historyEvents from "./parent-context-in-step.history.json";
3-
import { assertEventSignatures, createTests } from "../../../utils/test-helper";
3+
import { createTests } from "../../../utils/test-helper";
44

55
// Set shorter timeout for context validation tests since they should fail quickly
66
jest.setTimeout(5000);
@@ -9,7 +9,7 @@ createTests({
99
name: "context validation - parent context in step error",
1010
functionName: "parent-context-in-step",
1111
handler,
12-
tests: (runner) => {
12+
tests: (runner, { assertEventSignatures }) => {
1313
it("should fail when using parent context inside step function", async () => {
1414
const execution = await runner.run();
1515

packages/aws-durable-execution-sdk-js-examples/src/examples/context-validation/parent-context-in-wait-condition/parent-context-in-wait-condition.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { handler } from "./parent-context-in-wait-condition";
22
import historyEvents from "./parent-context-in-wait-condition.history.json";
3-
import { assertEventSignatures, createTests } from "../../../utils/test-helper";
3+
import { createTests } from "../../../utils/test-helper";
44
import {
55
ExecutionStatus,
66
OperationStatus,
@@ -13,7 +13,7 @@ createTests({
1313
name: "context validation - parent context in wait condition error",
1414
functionName: "parent-context-in-wait-condition",
1515
handler,
16-
tests: (runner) => {
16+
tests: (runner, { assertEventSignatures }) => {
1717
it("should fail when using parent context inside waitForCondition", async () => {
1818
const execution = await runner.run();
1919

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ createTests({
77
functionName: "create-callback-heartbeat",
88
handler,
99
invocationType: InvocationType.Event,
10-
tests: (runner, isCloud) => {
10+
tests: (runner, { isCloud }) => {
1111
it("should handle callback heartbeats during long-running tasks", async () => {
1212
const callbackOperation = runner.getOperation("long-running-task");
1313

packages/aws-durable-execution-sdk-js-examples/src/examples/handler-error/handler-error.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import { handler } from "./handler-error";
22
import historyEvents from "./handler-error.history.json";
3-
import { assertEventSignatures, createTests } from "../../utils/test-helper";
3+
import { createTests } from "../../utils/test-helper";
44
import { ExecutionStatus } from "@aws/durable-execution-sdk-js-testing";
55

66
createTests({
77
name: "handler-error test",
88
functionName: "handler-error",
99
handler,
10-
tests: (runner) => {
10+
tests: (runner, { assertEventSignatures }) => {
1111
it("should handle handler errors gracefully and capture error details", async () => {
1212
const result = await runner.run({ payload: { test: "error-case" } });
1313

packages/aws-durable-execution-sdk-js-examples/src/examples/hello-world/hello-world.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import { handler } from "./hello-world";
22
import historyEvents from "./hello-world.history.json";
3-
import { assertEventSignatures, createTests } from "../../utils/test-helper";
3+
import { createTests } from "../../utils/test-helper";
44

55
createTests({
66
name: "hello-world test",
77
functionName: "hello-world",
88
handler,
9-
tests: (runner) => {
9+
tests: (runner, { assertEventSignatures }) => {
1010
it("should return as expected with no operations", async () => {
1111
const execution = await runner.run();
1212

0 commit comments

Comments
 (0)