-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(core): Initial TestRunner service with basic test execution (no-…
…changelog) (#11735)
- Loading branch information
1 parent
6b23ad0
commit 845ba6c
Showing
10 changed files
with
661 additions
and
3 deletions.
There are no files selected for viewing
This file contains 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 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 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
171 changes: 171 additions & 0 deletions
171
packages/cli/src/evaluation/test-runner/__tests__/mock-data/execution-data.json
This file contains 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,171 @@ | ||
{ | ||
"startData": {}, | ||
"resultData": { | ||
"runData": { | ||
"When clicking ‘Test workflow’": [ | ||
{ | ||
"hints": [], | ||
"startTime": 1731079118048, | ||
"executionTime": 0, | ||
"source": [], | ||
"executionStatus": "success", | ||
"data": { | ||
"main": [ | ||
[ | ||
{ | ||
"json": { | ||
"query": "First item" | ||
}, | ||
"pairedItem": { | ||
"item": 0 | ||
} | ||
}, | ||
{ | ||
"json": { | ||
"query": "Second item" | ||
}, | ||
"pairedItem": { | ||
"item": 0 | ||
} | ||
}, | ||
{ | ||
"json": { | ||
"query": "Third item" | ||
}, | ||
"pairedItem": { | ||
"item": 0 | ||
} | ||
} | ||
] | ||
] | ||
} | ||
} | ||
], | ||
"Edit Fields": [ | ||
{ | ||
"hints": [], | ||
"startTime": 1731079118049, | ||
"executionTime": 0, | ||
"source": [ | ||
{ | ||
"previousNode": "When clicking ‘Test workflow’" | ||
} | ||
], | ||
"executionStatus": "success", | ||
"data": { | ||
"main": [ | ||
[ | ||
{ | ||
"json": { | ||
"foo": "bar" | ||
}, | ||
"pairedItem": { | ||
"item": 0 | ||
} | ||
}, | ||
{ | ||
"json": { | ||
"foo": "bar" | ||
}, | ||
"pairedItem": { | ||
"item": 1 | ||
} | ||
}, | ||
{ | ||
"json": { | ||
"foo": "bar" | ||
}, | ||
"pairedItem": { | ||
"item": 2 | ||
} | ||
} | ||
] | ||
] | ||
} | ||
} | ||
], | ||
"Code": [ | ||
{ | ||
"hints": [], | ||
"startTime": 1731079118049, | ||
"executionTime": 3, | ||
"source": [ | ||
{ | ||
"previousNode": "Edit Fields" | ||
} | ||
], | ||
"executionStatus": "success", | ||
"data": { | ||
"main": [ | ||
[ | ||
{ | ||
"json": { | ||
"foo": "bar", | ||
"random": 0.6315509336851373 | ||
}, | ||
"pairedItem": { | ||
"item": 0 | ||
} | ||
}, | ||
{ | ||
"json": { | ||
"foo": "bar", | ||
"random": 0.3336315687359024 | ||
}, | ||
"pairedItem": { | ||
"item": 1 | ||
} | ||
}, | ||
{ | ||
"json": { | ||
"foo": "bar", | ||
"random": 0.4241870158917733 | ||
}, | ||
"pairedItem": { | ||
"item": 2 | ||
} | ||
} | ||
] | ||
] | ||
} | ||
} | ||
] | ||
}, | ||
"pinData": { | ||
"When clicking ‘Test workflow’": [ | ||
{ | ||
"json": { | ||
"query": "First item" | ||
}, | ||
"pairedItem": { | ||
"item": 0 | ||
} | ||
}, | ||
{ | ||
"json": { | ||
"query": "Second item" | ||
}, | ||
"pairedItem": { | ||
"item": 0 | ||
} | ||
}, | ||
{ | ||
"json": { | ||
"query": "Third item" | ||
}, | ||
"pairedItem": { | ||
"item": 0 | ||
} | ||
} | ||
] | ||
}, | ||
"lastNodeExecuted": "Code" | ||
}, | ||
"executionData": { | ||
"contextData": {}, | ||
"nodeExecutionStack": [], | ||
"metadata": {}, | ||
"waitingExecution": {}, | ||
"waitingExecutionSource": {} | ||
} | ||
} |
124 changes: 124 additions & 0 deletions
124
packages/cli/src/evaluation/test-runner/__tests__/mock-data/workflow.evaluation.json
This file contains 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,124 @@ | ||
{ | ||
"name": "Evaluation Workflow", | ||
"nodes": [ | ||
{ | ||
"parameters": {}, | ||
"id": "285ac92b-256f-4bb2-a450-6486b01593cb", | ||
"name": "Execute Workflow Trigger", | ||
"type": "n8n-nodes-base.executeWorkflowTrigger", | ||
"typeVersion": 1, | ||
"position": [520, 340] | ||
}, | ||
{ | ||
"parameters": { | ||
"conditions": { | ||
"options": { | ||
"caseSensitive": true, | ||
"leftValue": "", | ||
"typeValidation": "strict", | ||
"version": 2 | ||
}, | ||
"conditions": [ | ||
{ | ||
"id": "9d3abc8d-3270-4bec-9a59-82622d5dbb5a", | ||
"leftValue": "={{ $json.actual.Code[0].data.main[0].length }}", | ||
"rightValue": 3, | ||
"operator": { | ||
"type": "number", | ||
"operation": "gte" | ||
} | ||
}, | ||
{ | ||
"id": "894ce84b-13a4-4415-99c0-0c25182903bb", | ||
"leftValue": "={{ $json.actual.Code[0].data.main[0][0].json.random }}", | ||
"rightValue": 0.7, | ||
"operator": { | ||
"type": "number", | ||
"operation": "lt" | ||
} | ||
} | ||
], | ||
"combinator": "and" | ||
}, | ||
"options": {} | ||
}, | ||
"id": "320b0355-3886-41df-b039-4666bf28e47b", | ||
"name": "If", | ||
"type": "n8n-nodes-base.if", | ||
"typeVersion": 2.2, | ||
"position": [740, 340] | ||
}, | ||
{ | ||
"parameters": { | ||
"assignments": { | ||
"assignments": [ | ||
{ | ||
"id": "3b65d55a-158f-40c6-9853-a1c44b7ba1e5", | ||
"name": "success", | ||
"value": true, | ||
"type": "boolean" | ||
} | ||
] | ||
}, | ||
"options": {} | ||
}, | ||
"id": "0c7a1ee8-0cf0-4d7f-99a3-186bbcd8815a", | ||
"name": "Success", | ||
"type": "n8n-nodes-base.set", | ||
"typeVersion": 3.4, | ||
"position": [980, 220] | ||
}, | ||
{ | ||
"parameters": { | ||
"assignments": { | ||
"assignments": [ | ||
{ | ||
"id": "6cc8b402-4a30-4873-b825-963a1f1b8b82", | ||
"name": "success", | ||
"value": false, | ||
"type": "boolean" | ||
} | ||
] | ||
}, | ||
"options": {} | ||
}, | ||
"id": "50d3f84a-d99f-4e04-bdbd-3e8c2668e708", | ||
"name": "Fail", | ||
"type": "n8n-nodes-base.set", | ||
"typeVersion": 3.4, | ||
"position": [980, 420] | ||
} | ||
], | ||
"connections": { | ||
"Execute Workflow Trigger": { | ||
"main": [ | ||
[ | ||
{ | ||
"node": "If", | ||
"type": "main", | ||
"index": 0 | ||
} | ||
] | ||
] | ||
}, | ||
"If": { | ||
"main": [ | ||
[ | ||
{ | ||
"node": "Success", | ||
"type": "main", | ||
"index": 0 | ||
} | ||
], | ||
[ | ||
{ | ||
"node": "Fail", | ||
"type": "main", | ||
"index": 0 | ||
} | ||
] | ||
] | ||
} | ||
}, | ||
"pinData": {} | ||
} |
Oops, something went wrong.