-
Notifications
You must be signed in to change notification settings - Fork 12
Set up E2E testing infrastructure aligned with durabletask-python #74
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
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
e54df6f
Testing pipeline setup
Copilot 89f2116
Merge branch 'main' of https://github.com/microsoft/durabletask-js in…
YunchuWang 43cbf9f
add ver 24
YunchuWang e5ad65a
module mapping
YunchuWang a6af72d
skip
YunchuWang f1152c0
cleanup
YunchuWang 567079c
jest test path adjust
YunchuWang 691e2bc
fix import
YunchuWang c53bb02
fix test
YunchuWang 06b90f2
fix
YunchuWang 7d4d811
fix insecure
YunchuWang a6c12f8
refactor
YunchuWang f3e27f4
fix callback in tests
YunchuWang 0b3eedc
linting fix
YunchuWang File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,11 @@ | ||
| # don't ever lint node_modules | ||
| node_modules | ||
| # don't lint build output (make sure it's set to your correct build folder name) | ||
| build | ||
| dist | ||
| # don't lint nyc coverage output | ||
| coverage | ||
| # don't lint proto files and output | ||
| proto | ||
| # don't ever lint node_modules | ||
| node_modules | ||
| # don't lint build output (make sure it's set to your correct build folder name) | ||
| build | ||
| dist | ||
| # don't lint nyc coverage output | ||
| coverage | ||
| # don't lint proto files and output | ||
| proto | ||
| # don't lint auto-generated version files | ||
| **/version.ts |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| name: 🧪 DTS Emulator E2E Tests | ||
|
|
||
| # This workflow runs E2E tests against the Durable Task Scheduler (DTS) emulator. | ||
| # It mirrors the Python testing setup at durabletask-python for Azure-managed tests. | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| pull_request: | ||
| branches: | ||
| - main | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| dts-e2e-tests: | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| node-version: ["22.x", "24.x"] | ||
| env: | ||
| EMULATOR_VERSION: "latest" | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: 📥 Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: 🐳 Pull Docker image | ||
| run: docker pull mcr.microsoft.com/dts/dts-emulator:$EMULATOR_VERSION | ||
|
|
||
| - name: 🚀 Run Docker container | ||
| run: | | ||
| docker run --name dtsemulator -d -p 8080:8080 mcr.microsoft.com/dts/dts-emulator:$EMULATOR_VERSION | ||
|
|
||
| - name: ⏳ Wait for container to be ready | ||
| run: sleep 10 # Adjust if your service needs more time to start | ||
|
|
||
| - name: 🔧 Set environment variables | ||
| run: | | ||
| echo "TASKHUB=default" >> $GITHUB_ENV | ||
| echo "ENDPOINT=localhost:8080" >> $GITHUB_ENV | ||
|
|
||
| - name: ⚙️ NodeJS - Install | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: ${{ matrix.node-version }} | ||
| registry-url: "https://registry.npmjs.org" | ||
|
|
||
| - name: ⚙️ Install dependencies | ||
| run: npm install | ||
|
|
||
| - name: ✅ Run E2E tests against DTS emulator | ||
| run: npm run test:e2e:azuremanaged:internal | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,48 +1,73 @@ | ||
| name: 🚀 Test and Build | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| pull_request: | ||
| branches: | ||
| - main | ||
|
|
||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| env: | ||
| NODE_VER: 22 | ||
|
|
||
| services: | ||
| # docker run --name durabletask-sidecar -p 4001:4001 --env 'DURABLETASK_SIDECAR_LOGLEVEL=Debug' --rm cgillum/durabletask-sidecar:latest start --backend Emulator | ||
| durabletask-sidecar: | ||
| image: cgillum/durabletask-sidecar:latest | ||
| ports: | ||
| - 4001:4001 | ||
| env: | ||
| DURABLETASK_SIDECAR_LOGLEVEL: Debug | ||
| DURABLETASK_STORAGE_PROVIDER: Emulator | ||
|
|
||
| steps: | ||
| - name: 📥 Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: ⚙️ NodeJS - Install | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: ${{ env.NODE_VER }} | ||
| registry-url: "https://registry.npmjs.org" | ||
|
|
||
| - name: ⚙️ Install dependencies | ||
| run: npm install | ||
|
|
||
| - name: 🔨 Build packages | ||
| run: npm run build | ||
|
|
||
| - name: ✅ Run unit tests | ||
| run: npm run test:unit | ||
|
|
||
| - name: ✅ Run e2e tests | ||
| run: npm run test:e2e | ||
| name: 🚀 Test and Build | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| pull_request: | ||
| branches: | ||
| - main | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| lint-and-unit-tests: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| env: | ||
| NODE_VER: 18.x | ||
|
|
||
| steps: | ||
| - name: 📥 Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: ⚙️ NodeJS - Install | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: ${{ env.NODE_VER }} | ||
| registry-url: "https://registry.npmjs.org" | ||
|
|
||
| - name: ⚙️ Install dependencies | ||
| run: npm install | ||
|
|
||
| - name: 🔍 Run linting | ||
| run: npm run lint | ||
|
|
||
| - name: ✅ Run unit tests | ||
| run: npm run test:unit | ||
|
|
||
| e2e-tests: | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| node-version: ["22.x", "24.x"] | ||
| needs: lint-and-unit-tests | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: 📥 Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: ⚙️ NodeJS - Install | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: ${{ matrix.node-version }} | ||
| registry-url: "https://registry.npmjs.org" | ||
|
|
||
| - name: ⚙️ Install dependencies | ||
| run: npm install | ||
|
|
||
| # Install Go SDK for durabletask-go sidecar | ||
| - name: 🔧 Install Go SDK | ||
| uses: actions/setup-go@v5 | ||
| with: | ||
| go-version: "stable" | ||
|
|
||
| # Install and run the durabletask-go sidecar for running e2e tests | ||
| - name: ✅ Run E2E tests with durabletask-go sidecar | ||
| run: | | ||
| go install github.com/microsoft/durabletask-go@main | ||
| durabletask-go --port 4001 & | ||
| sleep 5 # Wait for sidecar to be ready | ||
| npm run test:e2e:internal | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,60 +1,62 @@ | ||
| { | ||
| "name": "durabletask-js-monorepo", | ||
| "version": "0.0.0", | ||
| "private": true, | ||
| "description": "Durable Task JavaScript SDK monorepo", | ||
| "workspaces": [ | ||
| "packages/*" | ||
| ], | ||
| "scripts": { | ||
| "build": "npm run build --workspaces", | ||
| "build:core": "npm run build -w @microsoft/durabletask-js", | ||
| "build:azuremanaged": "npm run build -w @microsoft/durabletask-js-azuremanaged", | ||
| "test": "npm run test --workspaces", | ||
| "test:unit": "npm run test:unit --workspaces --if-present", | ||
| "test:e2e": "./scripts/test-e2e.sh", | ||
| "test:e2e:internal": "jest tests/e2e --runInBand --detectOpenHandles", | ||
| "test:e2e:one": "jest tests/e2e --runInBand --detectOpenHandles --testNamePattern", | ||
| "lint": "eslint . --ext .js,.jsx,.ts,.tsx", | ||
| "pretty": "prettier --list-different \"**/*.{ts,tsx,js,jsx,json,md}\"", | ||
| "pretty-fix": "prettier --write \"**/*.{ts,tsx,js,jsx,json,md}\"", | ||
| "download-proto": "./scripts/download-proto.sh", | ||
| "generate-grpc": "./tools/generate-grpc-javascript.sh ./packages/durabletask-js/src/proto", | ||
| "example": "ts-node --swc" | ||
| }, | ||
| "engines": { | ||
| "node": ">=22.0.0" | ||
| }, | ||
| "repository": { | ||
| "type": "git", | ||
| "url": "git+https://github.com/microsoft/durabletask-js.git" | ||
| }, | ||
| "license": "MIT", | ||
| "bugs": { | ||
| "url": "https://github.com/microsoft/durabletask-js/issues" | ||
| }, | ||
| "homepage": "https://github.com/microsoft/durabletask-js#readme", | ||
| "devDependencies": { | ||
| "@swc/core": "^1.3.55", | ||
| "@swc/helpers": "^0.5.1", | ||
| "@types/jest": "^29.5.1", | ||
| "@types/node": "^18.16.1", | ||
| "@typescript-eslint/eslint-plugin": "^5.1.0", | ||
| "@typescript-eslint/parser": "^5.1.0", | ||
| "dotenv": "^17.2.3", | ||
| "eslint": "^8.1.0", | ||
| "eslint-config-prettier": "^8.5.0", | ||
| "eslint-plugin-header": "^3.1.1", | ||
| "eslint-plugin-prettier": "^4.2.1", | ||
| "grpc_tools_node_protoc_ts": "^5.3.3", | ||
| "grpc-tools": "^1.13.1", | ||
| "husky": "^8.0.1", | ||
| "jest": "^29.5.0", | ||
| "nodemon": "^3.1.4", | ||
| "prettier": "^2.4.0", | ||
| "pretty-quick": "^3.1.3", | ||
| "ts-jest": "^29.1.0", | ||
| "ts-node": "^10.9.1", | ||
| "typescript": "^5.0.4" | ||
| } | ||
| } | ||
| { | ||
| "name": "durabletask-js-monorepo", | ||
| "version": "0.0.0", | ||
| "private": true, | ||
| "description": "Durable Task JavaScript SDK monorepo", | ||
| "workspaces": [ | ||
| "packages/*" | ||
| ], | ||
| "scripts": { | ||
| "build": "npm run build --workspaces", | ||
| "build:core": "npm run build -w @microsoft/durabletask-js", | ||
| "build:azuremanaged": "npm run build -w @microsoft/durabletask-js-azuremanaged", | ||
| "test": "npm run test --workspaces", | ||
| "test:unit": "npm run test:unit --workspaces --if-present", | ||
| "test:e2e": "./scripts/test-e2e.sh", | ||
| "test:e2e:internal": "jest tests/e2e --runInBand --detectOpenHandles", | ||
| "test:e2e:one": "jest tests/e2e --runInBand --detectOpenHandles --testNamePattern", | ||
| "test:e2e:azuremanaged:internal": "jest test/e2e-azuremanaged --runInBand --detectOpenHandles", | ||
| "test:e2e:azuremanaged": "./scripts/test-e2e-azuremanaged.sh", | ||
| "lint": "eslint . --ext .js,.jsx,.ts,.tsx", | ||
| "pretty": "prettier --list-different \"**/*.{ts,tsx,js,jsx,json,md}\"", | ||
| "pretty-fix": "prettier --write \"**/*.{ts,tsx,js,jsx,json,md}\"", | ||
| "download-proto": "./scripts/download-proto.sh", | ||
| "generate-grpc": "./tools/generate-grpc-javascript.sh ./packages/durabletask-js/src/proto", | ||
| "example": "ts-node --swc" | ||
| }, | ||
| "engines": { | ||
| "node": ">=22.0.0" | ||
| }, | ||
| "repository": { | ||
| "type": "git", | ||
| "url": "git+https://github.com/microsoft/durabletask-js.git" | ||
| }, | ||
| "license": "MIT", | ||
| "bugs": { | ||
| "url": "https://github.com/microsoft/durabletask-js/issues" | ||
| }, | ||
| "homepage": "https://github.com/microsoft/durabletask-js#readme", | ||
| "devDependencies": { | ||
| "@swc/core": "^1.3.55", | ||
| "@swc/helpers": "^0.5.1", | ||
| "@types/jest": "^29.5.1", | ||
| "@types/node": "^18.16.1", | ||
| "@typescript-eslint/eslint-plugin": "^5.1.0", | ||
| "@typescript-eslint/parser": "^5.1.0", | ||
| "dotenv": "^17.2.3", | ||
| "eslint": "^8.1.0", | ||
| "eslint-config-prettier": "^8.5.0", | ||
| "eslint-plugin-header": "^3.1.1", | ||
| "eslint-plugin-prettier": "^4.2.1", | ||
| "grpc_tools_node_protoc_ts": "^5.3.3", | ||
| "grpc-tools": "^1.13.1", | ||
| "husky": "^8.0.1", | ||
| "jest": "^29.5.0", | ||
| "nodemon": "^3.1.4", | ||
| "prettier": "^2.4.0", | ||
| "pretty-quick": "^3.1.3", | ||
| "ts-jest": "^29.1.0", | ||
| "ts-node": "^10.9.1", | ||
| "typescript": "^5.0.4" | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.