Skip to content

Updated E2E tests to use latest stable Dapr version for CLI and runtime #686

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 12 commits into from
Mar 14, 2025
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 .github/workflows/test-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ jobs:
runs-on: ubuntu-latest
env:
GOVER: 1.22
DAPR_CLI_VER: 1.14.0
DAPR_RUNTIME_VER: 1.14.1
DAPR_CLI_VER: 1.15.0
DAPR_RUNTIME_VER: 1.15.3
DAPR_INSTALL_URL: https://raw.githubusercontent.com/dapr/cli/master/install/install.sh
DAPR_CLI_REF: ""
DAPR_REF: ""
Expand Down
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,21 @@
"scripts": {
"test": "npm run test:unit:all && npm run test:e2e:all",
"test:load": "jest --runInBand --detectOpenHandles",
"test:load:http": "TEST_SECRET_1=secret_val_1 TEST_SECRET_2=secret_val_2 dapr run --app-id test-suite --app-protocol http --app-port 50001 --dapr-http-port 50000 --components-path ./test/components -- npm run test:load 'test/load'",
"test:load:http": "TEST_SECRET_1=secret_val_1 TEST_SECRET_2=secret_val_2 dapr run --app-id test-suite --app-protocol http --app-port 50001 --dapr-http-port 50000 --resources-path ./test/components -- npm run test:load 'test/load'",
"test:e2e": "jest --runInBand --detectOpenHandles",
"test:e2e:all": "npm run test:e2e:http && npm run test:e2e:grpc && npm run test:e2e:common && npm run test:e2e:workflow",
"test:e2e:grpc": "npm run test:e2e:grpc:client && npm run test:e2e:grpc:server && npm run test:e2e:grpc:clientWithApiToken",
"test:e2e:grpc:client": "npm run prebuild && TEST_SECRET_1=secret_val_1 TEST_SECRET_2=secret_val_2 dapr run --app-id test-suite --app-protocol grpc --app-port 50001 --dapr-grpc-port 50000 --components-path ./test/components -- jest --runInBand --detectOpenHandles --testMatch [ '**/test/e2e/grpc/*client.test.ts' ]",
"test:e2e:grpc:clientWithApiToken": "npm run prebuild && TEST_SECRET_1=secret_val_1 TEST_SECRET_2=secret_val_2 DAPR_API_TOKEN=test dapr run --app-id test-suite --app-protocol grpc --app-port 50001 --dapr-grpc-port 50000 --components-path ./test/components -- jest --runInBand --detectOpenHandles --testMatch [ '**/test/e2e/grpc/clientWithApiToken.test.ts' ]",
"test:e2e:grpc:server": "npm run prebuild && TEST_SECRET_1=secret_val_1 TEST_SECRET_2=secret_val_2 dapr run --app-id test-suite --app-protocol grpc --app-port 50001 --dapr-grpc-port 50000 --dapr-http-max-request-size 10 --components-path ./test/components -- jest --runInBand --detectOpenHandles --testMatch [ '**/test/e2e/grpc/*server.test.ts' ]",
"test:e2e:grpc:client": "npm run prebuild && TEST_SECRET_1=secret_val_1 TEST_SECRET_2=secret_val_2 dapr run --app-id test-suite --app-protocol grpc --app-port 50001 --dapr-grpc-port 50000 --resources-path ./test/components -- jest --runInBand --detectOpenHandles --testMatch [ '**/test/e2e/grpc/*client.test.ts' ]",
"test:e2e:grpc:clientWithApiToken": "npm run prebuild && TEST_SECRET_1=secret_val_1 TEST_SECRET_2=secret_val_2 DAPR_API_TOKEN=test dapr run --app-id test-suite --app-protocol grpc --app-port 50001 --dapr-grpc-port 50000 --resources-path ./test/components -- jest --runInBand --detectOpenHandles --testMatch [ '**/test/e2e/grpc/clientWithApiToken.test.ts' ]",
"test:e2e:grpc:server": "npm run prebuild && TEST_SECRET_1=secret_val_1 TEST_SECRET_2=secret_val_2 dapr run --app-id test-suite --app-protocol grpc --app-port 50001 --dapr-grpc-port 50000 --max-body-size 10Mi --resources-path ./test/components -- jest --runInBand --detectOpenHandles --testMatch [ '**/test/e2e/grpc/*server.test.ts' ]",
"test:e2e:http": "npm run test:e2e:http:client && npm run test:e2e:http:server && npm run test:e2e:http:actors",
"test:e2e:http:client": "npm run prebuild && TEST_SECRET_1=secret_val_1 TEST_SECRET_2=secret_val_2 dapr run --app-id test-suite --app-protocol http --app-port 50001 --dapr-http-port 50000 --components-path ./test/components -- jest --runInBand --detectOpenHandles --testMatch [ '**/test/e2e/http/(client).test.ts' ]",
"test:e2e:http:server": "npm run prebuild && TEST_SECRET_1=secret_val_1 TEST_SECRET_2=secret_val_2 dapr run --app-id test-suite --app-protocol http --app-port 50001 --dapr-http-port 50000 --dapr-http-max-request-size 10 --components-path ./test/components -- jest --runInBand --detectOpenHandles --testMatch [ '**/test/e2e/http/(server).test.ts' ]",
"test:e2e:http:actors": "npm run prebuild && TEST_SECRET_1=secret_val_1 TEST_SECRET_2=secret_val_2 dapr run --app-id test-suite --app-protocol http --app-port 50001 --dapr-http-port 50000 --components-path ./test/components -- jest --runInBand --detectOpenHandles --testMatch [ '**/test/e2e/http/actors.test.ts' ]",
"test:e2e:http:client": "npm run prebuild && TEST_SECRET_1=secret_val_1 TEST_SECRET_2=secret_val_2 dapr run --app-id test-suite --app-protocol http --app-port 50001 --dapr-http-port 50000 --resources-path ./test/components -- jest --runInBand --detectOpenHandles --testMatch [ '**/test/e2e/http/(client).test.ts' ]",
"test:e2e:http:server": "npm run prebuild && TEST_SECRET_1=secret_val_1 TEST_SECRET_2=secret_val_2 dapr run --app-id test-suite --app-protocol http --app-port 50001 --dapr-http-port 50000 --max-body-size 10Mi --resources-path ./test/components -- jest --runInBand --detectOpenHandles --testMatch [ '**/test/e2e/http/(server).test.ts' ]",
"test:e2e:http:actors": "npm run prebuild && TEST_SECRET_1=secret_val_1 TEST_SECRET_2=secret_val_2 dapr run --app-id test-suite --app-protocol http --app-port 50001 --dapr-http-port 50000 --resources-path ./test/components -- jest --runInBand --detectOpenHandles --testMatch [ '**/test/e2e/http/actors.test.ts' ]",
"test:e2e:common": "npm run test:e2e:common:client && npm run test:e2e:common:server",
"test:e2e:common:client": "./scripts/test-e2e-common.sh client",
"test:e2e:common:server": "./scripts/test-e2e-common.sh server",
"test:e2e:workflow": "npm run prebuild && dapr run --app-id workflow-test-suite --app-protocol grpc --dapr-grpc-port 4001 --components-path ./test/components/workflow -- jest --runInBand --detectOpenHandles --testMatch [ '**/test/e2e/workflow/workflow.test.ts' ]",
"test:e2e:workflow": "npm run prebuild && dapr run --app-id workflow-test-suite --app-protocol grpc --dapr-grpc-port 4001 --resources-path ./test/components/workflow -- jest --runInBand --detectOpenHandles --testMatch [ '**/test/e2e/workflow/workflow.test.ts' ]",
"test:e2e:workflow:internal": "jest test/e2e/workflow --runInBand --detectOpenHandles",
"test:e2e:workflow:durabletask": "./scripts/test-e2e-workflow.sh",
"test:unit": "jest --runInBand --detectOpenHandles",
Expand Down
2 changes: 1 addition & 1 deletion test/actor/DemoActorReminderImpl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default class DemoActorReminderImpl extends AbstractActor implements Demo
async init(): Promise<string> {
await super.registerActorReminder(
"my-reminder-name",
Temporal.Duration.from({ milliseconds: 1500 }),
Temporal.Duration.from({ milliseconds: 1000 }),
Temporal.Duration.from({ seconds: 1 }),
undefined,
123,
Expand Down
4 changes: 2 additions & 2 deletions test/actor/DemoActorReminderTtlImpl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ export default class DemoActorReminderTtlImpl extends AbstractActor implements D
async init(): Promise<string> {
await super.registerActorReminder(
"my-reminder-name",
Temporal.Duration.from({ milliseconds: 1500 }), //dueTime
Temporal.Duration.from({ seconds: 1 }), //period
Temporal.Duration.from({ milliseconds: 1000 }), //dueTime
Temporal.Duration.from({ milliseconds: 2000 }), //period
Temporal.Duration.from({ seconds: 1 }), //ttl
123,
);
Expand Down
10 changes: 5 additions & 5 deletions test/e2e/http/actors.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -360,8 +360,8 @@ describe("http/actors", () => {
const res0 = await actor.getCounter();
expect(res0).toEqual(0);

// Now we wait for dueTime (1.5s)
await NodeJSUtil.sleep(1500);
// Now we wait for dueTime (1s)
await NodeJSUtil.sleep(1200);

// After that the reminder callback will be called
// In our case, the callback increments the count attribute
Expand All @@ -370,10 +370,10 @@ describe("http/actors", () => {

await actor.removeReminder();

// Now we wait an extra period - duration (1s)
await new Promise((resolve) => setTimeout(resolve, 1000));
// Now we wait an extra period - duration (seconds)
await new Promise((resolve) => setTimeout(resolve, 1500));

// Make sure the counter didn't change as we removed it
// Make sure the counter didn't change since we removed the reminder
const res2 = await actor.getCounter();
expect(res2).toEqual(123);
});
Expand Down