-
Notifications
You must be signed in to change notification settings - Fork 1
add integration test flows #16
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
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
57 changes: 57 additions & 0 deletions
57
api-tests/error-boundary/error-boundary-test-workflow.http
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,57 @@ | ||
| @baseUrl = http://localhost:4201 | ||
| @apiVersion = 1 | ||
| @domain = core | ||
| @workflow = error-boundary-test-workflow | ||
| @mocklabBaseUrl = http://localhost:3002 | ||
|
|
||
| ############################################################################### | ||
| # Error boundary integration: HTTP 500 retries (task boundary), script error | ||
| # ignored (state boundary; errorTypes/errorCodes rules), rollback (action 2) | ||
| # then log (action 5), notify-test-state (onError action 4 + transition), then | ||
| # completed-state. Global errorBoundary includes onTimeout (action 3). | ||
| # Requires: API with MocklabBaseUrl, Mocklab seeded (POST api/test/error-endpoint | ||
| # returns 500). Task-level retries use PT2S delays (expect several seconds). | ||
| ############################################################################### | ||
|
|
||
| ### Adim 1: Workflow baslat (sync; HTTP task retries may add delay) | ||
| # @name createErrorBoundaryInstance | ||
| POST {{baseUrl}}/api/v{{apiVersion}}/{{domain}}/workflows/{{workflow}}/instances/start?sync=true | ||
| Content-Type: application/json | ||
|
|
||
| { | ||
| "key": "error-boundary-test-{{$timestamp}}", | ||
| "tags": ["integration-test", "error-boundary"], | ||
| "attributes": {} | ||
| } | ||
|
|
||
| @errorBoundaryInstanceId = {{createErrorBoundaryInstance.response.body.$.id}} | ||
|
|
||
| ### Adim 2: Durum (notify-test-state uzerinden completed-state beklenir; global abort veya basarisizlikta error-final) | ||
| GET {{baseUrl}}/api/v{{apiVersion}}/{{domain}}/workflows/{{workflow}}/instances/{{errorBoundaryInstanceId}}/functions/state | ||
|
|
||
| ### Adim 3: Instance data (errorTestStarted, httpErrorHandled, errorIgnored, rollbackExecuted, rollbackAt, logOnlyExecuted, notifyExecuted, notifyAt) | ||
| GET {{baseUrl}}/api/v{{apiVersion}}/{{domain}}/workflows/{{workflow}}/instances/{{errorBoundaryInstanceId}}/functions/data | ||
|
|
||
| ############################################################################### | ||
| # Paket 5 — Rollback (2) + Log (5): Adim 3 yanitinda asagidakiler dogrulanir: | ||
| # - errorIgnored: true (ignore-test-state) | ||
| # - rollbackExecuted: true, rollbackAt: ISO8601 (rollback-test-state, ThrowError + rollback policy) | ||
| # - logOnlyExecuted: true (log-test-state; ThrowError + log policy, sonra LogOnlyMapping) | ||
| ############################################################################### | ||
|
|
||
| ############################################################################### | ||
| # Paket 6 — Notify (action 4), timeoutPolicy, errorTypes/errorCodes | ||
| # | ||
| # Notify (action 4): notify-test-state ilk gorevde ThrowErrorMapping ile hata | ||
| # uretir; errorBoundary onError action 4 + transition ile akis completed-state'e | ||
| # gider. Adim 3 yanitinda notifyExecuted: true ve notifyAt: ISO8601 dogrulanir. | ||
| # | ||
| # timeoutPolicy: workflow attributes.errorBoundary.onTimeout.action = 3 (ignore). | ||
| # Tam timeout senaryosu bu dosyada ayri istek gerektirir; motor global timeout | ||
| # uyguladiginda bu politikanin secildigini workflow tanimindan dogrulayin. | ||
| # | ||
| # errorTypes / errorCodes: ignore-test-state errorBoundary kurali | ||
| # errorTypes: ["System.InvalidOperationException"], errorCodes: ["*"]. | ||
| # Ilk script gorevinin firlattigi istisna tipi bu listeyle eslesmeli; aksi halde | ||
| # ignore kurali tetiklenmez (motorun davranisina gore abort veya ust boundary). | ||
| ############################################################################### |
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,146 @@ | ||
| { | ||
| "info": { | ||
| "_postman_id": "b383d938-352a-4425-a364-3e3f27ce9306", | ||
| "name": "vNext Test - Error Boundary", | ||
| "description": "Auto-generated from error-boundary-test-workflow.http.\nvNext workflow integration test collection for error-boundary.", | ||
| "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" | ||
| }, | ||
| "variable": [ | ||
| { | ||
| "key": "baseUrl", | ||
| "value": "http://localhost:4201", | ||
| "type": "string" | ||
| }, | ||
| { | ||
| "key": "apiVersion", | ||
| "value": "1", | ||
| "type": "string" | ||
| }, | ||
| { | ||
| "key": "domain", | ||
| "value": "core", | ||
| "type": "string" | ||
| }, | ||
| { | ||
| "key": "workflow", | ||
| "value": "error-boundary-test-workflow", | ||
| "type": "string" | ||
| }, | ||
| { | ||
| "key": "mocklabBaseUrl", | ||
| "value": "http://localhost:3002", | ||
| "type": "string" | ||
| } | ||
| ], | ||
| "item": [ | ||
| { | ||
| "name": "Adim 1: Workflow baslat (sync; HTTP task retries may add delay)", | ||
| "request": { | ||
| "method": "POST", | ||
| "header": [ | ||
| { | ||
| "key": "Content-Type", | ||
| "value": "application/json", | ||
| "type": "text" | ||
| } | ||
| ], | ||
| "url": { | ||
| "raw": "{{baseUrl}}/api/v{{apiVersion}}/{{domain}}/workflows/{{workflow}}/instances/start?sync=true", | ||
| "host": [ | ||
| "{{baseUrl}}" | ||
| ], | ||
| "path": [ | ||
| "api", | ||
| "v{{apiVersion}}", | ||
| "{{domain}}", | ||
| "workflows", | ||
| "{{workflow}}", | ||
| "instances", | ||
| "start" | ||
| ], | ||
| "query": [ | ||
| { | ||
| "key": "sync", | ||
| "value": "true" | ||
| } | ||
| ] | ||
| }, | ||
| "body": { | ||
| "mode": "raw", | ||
| "raw": "{\n \"key\": \"error-boundary-test-{{$timestamp}}\",\n \"tags\": [\"integration-test\", \"error-boundary\"],\n \"attributes\": {}\n}", | ||
| "options": { | ||
| "raw": { | ||
| "language": "json" | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| "response": [], | ||
| "event": [ | ||
| { | ||
| "listen": "test", | ||
| "script": { | ||
| "type": "text/javascript", | ||
| "exec": [ | ||
| "var jsonData = pm.response.json();", | ||
| "if (jsonData && jsonData.id) {", | ||
| " pm.collectionVariables.set(\"errorBoundaryInstanceId\", jsonData.id);", | ||
| " console.log(\"errorBoundaryInstanceId set to: \" + jsonData.id);", | ||
| "}" | ||
| ] | ||
| } | ||
| } | ||
| ] | ||
| }, | ||
| { | ||
| "name": "Adim 2: Durum (notify-test-state uzerinden completed-state beklenir; global abort veya basarisizlikta error-final)", | ||
| "request": { | ||
| "method": "GET", | ||
| "header": [], | ||
| "url": { | ||
| "raw": "{{baseUrl}}/api/v{{apiVersion}}/{{domain}}/workflows/{{workflow}}/instances/{{errorBoundaryInstanceId}}/functions/state", | ||
| "host": [ | ||
| "{{baseUrl}}" | ||
| ], | ||
| "path": [ | ||
| "api", | ||
| "v{{apiVersion}}", | ||
| "{{domain}}", | ||
| "workflows", | ||
| "{{workflow}}", | ||
| "instances", | ||
| "{{errorBoundaryInstanceId}}", | ||
| "functions", | ||
| "state" | ||
| ] | ||
| } | ||
| }, | ||
| "response": [] | ||
| }, | ||
| { | ||
| "name": "Adim 3: Instance data (errorTestStarted, httpErrorHandled, errorIgnored, rollbackExecuted, rollbackAt, logOnlyExecuted, notifyExecuted, notifyAt)", | ||
| "request": { | ||
| "method": "GET", | ||
| "header": [], | ||
| "url": { | ||
| "raw": "{{baseUrl}}/api/v{{apiVersion}}/{{domain}}/workflows/{{workflow}}/instances/{{errorBoundaryInstanceId}}/functions/data", | ||
| "host": [ | ||
| "{{baseUrl}}" | ||
| ], | ||
| "path": [ | ||
| "api", | ||
| "v{{apiVersion}}", | ||
| "{{domain}}", | ||
| "workflows", | ||
| "{{workflow}}", | ||
| "instances", | ||
| "{{errorBoundaryInstanceId}}", | ||
| "functions", | ||
| "data" | ||
| ] | ||
| } | ||
| }, | ||
| "response": [] | ||
| } | ||
| ] | ||
| } |
59 changes: 59 additions & 0 deletions
59
api-tests/extended-tasks/extended-tasks-test-workflow.http
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,59 @@ | ||
| @baseUrl = http://localhost:4201 | ||
| @apiVersion = 1 | ||
| @domain = core | ||
| @workflow = extended-tasks-test-workflow | ||
|
|
||
| ### ============================================================ | ||
| ### TEST 1: Happy Path - Tum Task Tipleri Zinciri | ||
| ### Dapr HTTP (1) → Dapr Service (3) → Dapr Binding (2) → | ||
| ### Dapr PubSub (4) → Notification (10) → TriggerTransition (12) → | ||
| ### SubProcess (14) → GetInstances (15) → Human Task (5) → Completed | ||
| ### ============================================================ | ||
|
|
||
| ### Adim 1: Workflow Baslat | ||
| # @name createInstance | ||
| POST {{baseUrl}}/api/v{{apiVersion}}/{{domain}}/workflows/{{workflow}}/instances/start | ||
| Content-Type: application/json | ||
|
|
||
| { | ||
| "key": "extended-tasks-test-{{$timestamp}}", | ||
| "tags": ["extended-tasks-test"], | ||
| "attributes": { | ||
| "testId": "extended-tasks-happy-path" | ||
| } | ||
| } | ||
|
|
||
| ### Response'dan instance ID'yi yakala | ||
| @instanceId = {{createInstance.response.body.$.id}} | ||
|
|
||
| ### Adim 2: Durum Kontrol - Auto zincir sonrasi human-task-state'de beklenmeli | ||
| GET {{baseUrl}}/api/v{{apiVersion}}/{{domain}}/workflows/{{workflow}}/instances/{{instanceId}}/functions/state | ||
|
|
||
| ### Adim 3: Instance Data Kontrol - Tum task sonuclarini kontrol et | ||
| GET {{baseUrl}}/api/v{{apiVersion}}/{{domain}}/workflows/{{workflow}}/instances/{{instanceId}} | ||
|
|
||
| ### Adim 4: Human Task Onayla (manuel transition) | ||
| PATCH {{baseUrl}}/api/v{{apiVersion}}/{{domain}}/workflows/{{workflow}}/instances/{{instanceId}}/transitions/approve-human-task | ||
| Content-Type: application/json | ||
|
|
||
| {} | ||
|
|
||
| ### Adim 5: Durum Kontrol - completed-state olmali | ||
| GET {{baseUrl}}/api/v{{apiVersion}}/{{domain}}/workflows/{{workflow}}/instances/{{instanceId}}/functions/state | ||
|
|
||
| ### Adim 6: Final Instance Data - Tum task sonuclari mevcut olmali | ||
| GET {{baseUrl}}/api/v{{apiVersion}}/{{domain}}/workflows/{{workflow}}/instances/{{instanceId}} | ||
|
|
||
| ### ============================================================ | ||
| ### Beklenen Sonuclar: | ||
| ### - initCompleted: true | ||
| ### - taskResults.daprHttp.completed: true | ||
| ### - taskResults.daprService.completed: true | ||
| ### - taskResults.daprBinding.completed: true | ||
| ### - taskResults.daprPubSub.completed: true | ||
| ### - taskResults.notification.completed: true | ||
| ### - taskResults.triggerTransition.completed: true | ||
| ### - taskResults.subprocess.completed: true | ||
| ### - taskResults.getInstances.completed: true | ||
| ### - taskResults.humanTask.completed: true | ||
| ### ============================================================ |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This block is a duplicate of lines 279-280. You can remove it to keep the
.gitignorefile clean and avoid redundancy.