@midscene/core 1.12.10-beta-20260920031616.0 → 1.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/agent/agent.mjs +103 -6
- package/dist/es/agent/agent.mjs.map +1 -1
- package/dist/es/agent/index.mjs +4 -3
- package/dist/es/agent/tasks.mjs +2 -2
- package/dist/es/agent/tasks.mjs.map +1 -1
- package/dist/es/agent/test-runner-nodes.mjs +291 -40
- package/dist/es/agent/test-runner-nodes.mjs.map +1 -1
- package/dist/es/agent/utils.mjs +1 -1
- package/dist/es/device/index.mjs +15 -2
- package/dist/es/device/index.mjs.map +1 -1
- package/dist/es/dump/html-utils.mjs +37 -4
- package/dist/es/dump/html-utils.mjs.map +1 -1
- package/dist/es/dump/screenshot-store.mjs +8 -1
- package/dist/es/dump/screenshot-store.mjs.map +1 -1
- package/dist/es/report-cli.mjs +9 -4
- package/dist/es/report-cli.mjs.map +1 -1
- package/dist/es/report-generator.mjs +117 -4
- package/dist/es/report-generator.mjs.map +1 -1
- package/dist/es/report-html-template.mjs +1 -1
- package/dist/es/report.mjs +190 -41
- package/dist/es/report.mjs.map +1 -1
- package/dist/es/test-run-report.mjs.map +1 -1
- package/dist/es/test-runner/engine/case-runner.mjs +52 -0
- package/dist/es/test-runner/engine/case-runner.mjs.map +1 -0
- package/dist/es/test-runner/engine/document-runtime.mjs +273 -0
- package/dist/es/test-runner/engine/document-runtime.mjs.map +1 -0
- package/dist/es/test-runner/engine/execute-step.mjs +177 -0
- package/dist/es/test-runner/engine/execute-step.mjs.map +1 -0
- package/dist/es/test-runner/engine/execution-failure.mjs +39 -0
- package/dist/es/test-runner/engine/execution-failure.mjs.map +1 -0
- package/dist/es/test-runner/engine/index.mjs +12 -0
- package/dist/es/test-runner/engine/project-runtime.mjs +142 -0
- package/dist/es/test-runner/engine/project-runtime.mjs.map +1 -0
- package/dist/es/test-runner/engine/registry.mjs +61 -0
- package/dist/es/test-runner/engine/registry.mjs.map +1 -0
- package/dist/es/test-runner/engine/resource-operations.mjs +211 -0
- package/dist/es/test-runner/engine/resource-operations.mjs.map +1 -0
- package/dist/es/test-runner/engine/run-collected-case.mjs +193 -0
- package/dist/es/test-runner/engine/run-collected-case.mjs.map +1 -0
- package/dist/es/test-runner/engine/run-workflow-document.mjs +155 -0
- package/dist/es/test-runner/engine/run-workflow-document.mjs.map +1 -0
- package/dist/es/test-runner/engine/scheduler.mjs +27 -0
- package/dist/es/test-runner/engine/scheduler.mjs.map +1 -0
- package/dist/es/test-runner/engine/scope-teardown.mjs +16 -0
- package/dist/es/test-runner/engine/scope-teardown.mjs.map +1 -0
- package/dist/es/test-runner/engine/types.mjs +0 -0
- package/dist/es/test-runner/errors.mjs +201 -0
- package/dist/es/test-runner/errors.mjs.map +1 -0
- package/dist/es/test-runner/execution-record.mjs +83 -0
- package/dist/es/test-runner/execution-record.mjs.map +1 -0
- package/dist/es/test-runner/index.mjs +12 -0
- package/dist/es/test-runner/node/define-node.mjs +44 -0
- package/dist/es/test-runner/node/define-node.mjs.map +1 -0
- package/dist/es/test-runner/node/index.mjs +2 -0
- package/dist/es/test-runner/node/types.mjs +0 -0
- package/dist/es/test-runner/parser/document-format.mjs +21 -0
- package/dist/es/test-runner/parser/document-format.mjs.map +1 -0
- package/dist/es/test-runner/parser/normalize.mjs +87 -0
- package/dist/es/test-runner/parser/normalize.mjs.map +1 -0
- package/dist/es/test-runner/parser/types.mjs +0 -0
- package/dist/es/test-runner/project.mjs +0 -0
- package/dist/es/test-runner/reporting/agent-report.mjs +23 -0
- package/dist/es/test-runner/reporting/agent-report.mjs.map +1 -0
- package/dist/es/test-runner/reporting/execution-record.mjs +73 -0
- package/dist/es/test-runner/reporting/execution-record.mjs.map +1 -0
- package/dist/es/test-runner/reporting/merge-report.mjs +231 -0
- package/dist/es/test-runner/reporting/merge-report.mjs.map +1 -0
- package/dist/es/test-runner/reporting/sanitize.mjs +162 -0
- package/dist/es/test-runner/reporting/sanitize.mjs.map +1 -0
- package/dist/es/test-runner/reporting/test-run-report.mjs +327 -0
- package/dist/es/test-runner/reporting/test-run-report.mjs.map +1 -0
- package/dist/es/test-runner/reporting/types.mjs +0 -0
- package/dist/es/utils.mjs +1 -1
- package/dist/es/yaml/execution-context.node.mjs +6 -0
- package/dist/es/yaml/execution-context.node.mjs.map +1 -0
- package/dist/es/yaml/execution-context.stub.mjs +8 -0
- package/dist/es/yaml/execution-context.stub.mjs.map +1 -0
- package/dist/es/yaml/execution-session.mjs +90 -0
- package/dist/es/yaml/execution-session.mjs.map +1 -0
- package/dist/es/yaml/index.mjs +2 -1
- package/dist/es/yaml/legacy-yaml-execution-record.mjs +47 -0
- package/dist/es/yaml/legacy-yaml-execution-record.mjs.map +1 -0
- package/dist/es/yaml/legacy-yaml-report.mjs +52 -0
- package/dist/es/yaml/legacy-yaml-report.mjs.map +1 -0
- package/dist/es/yaml/legacy-yaml-runtime.mjs +119 -0
- package/dist/es/yaml/legacy-yaml-runtime.mjs.map +1 -0
- package/dist/es/yaml/player-state.mjs +15 -0
- package/dist/es/yaml/player-state.mjs.map +1 -0
- package/dist/es/yaml/player.mjs +214 -348
- package/dist/es/yaml/player.mjs.map +1 -1
- package/dist/es/yaml/report-policy.mjs +7 -0
- package/dist/es/yaml/report-policy.mjs.map +1 -0
- package/dist/es/yaml/test-runner-compat.mjs +301 -0
- package/dist/es/yaml/test-runner-compat.mjs.map +1 -0
- package/dist/es/yaml/test-runner-nodes.mjs +147 -0
- package/dist/es/yaml/test-runner-nodes.mjs.map +1 -0
- package/dist/es/yaml/utils.mjs +12 -1
- package/dist/es/yaml/utils.mjs.map +1 -1
- package/dist/es/yaml-runtime.mjs +7 -0
- package/dist/es/yaml.mjs.map +1 -1
- package/dist/lib/agent/agent.js +103 -6
- package/dist/lib/agent/agent.js.map +1 -1
- package/dist/lib/agent/index.js +37 -3
- package/dist/lib/agent/tasks.js +2 -2
- package/dist/lib/agent/tasks.js.map +1 -1
- package/dist/lib/agent/test-runner-nodes.js +329 -45
- package/dist/lib/agent/test-runner-nodes.js.map +1 -1
- package/dist/lib/agent/utils.js +1 -1
- package/dist/lib/device/index.js +15 -2
- package/dist/lib/device/index.js.map +1 -1
- package/dist/lib/dump/html-utils.js +43 -4
- package/dist/lib/dump/html-utils.js.map +1 -1
- package/dist/lib/dump/screenshot-store.js +8 -1
- package/dist/lib/dump/screenshot-store.js.map +1 -1
- package/dist/lib/report-cli.js +8 -3
- package/dist/lib/report-cli.js.map +1 -1
- package/dist/lib/report-generator.js +114 -1
- package/dist/lib/report-generator.js.map +1 -1
- package/dist/lib/report-html-template.js +1 -1
- package/dist/lib/report.js +187 -38
- package/dist/lib/report.js.map +1 -1
- package/dist/lib/test-run-report.js.map +1 -1
- package/dist/lib/test-runner/engine/case-runner.js +89 -0
- package/dist/lib/test-runner/engine/case-runner.js.map +1 -0
- package/dist/lib/test-runner/engine/document-runtime.js +307 -0
- package/dist/lib/test-runner/engine/document-runtime.js.map +1 -0
- package/dist/lib/test-runner/engine/execute-step.js +211 -0
- package/dist/lib/test-runner/engine/execute-step.js.map +1 -0
- package/dist/lib/test-runner/engine/execution-failure.js +79 -0
- package/dist/lib/test-runner/engine/execution-failure.js.map +1 -0
- package/dist/lib/test-runner/engine/index.js +137 -0
- package/dist/lib/test-runner/engine/index.js.map +1 -0
- package/dist/lib/test-runner/engine/project-runtime.js +176 -0
- package/dist/lib/test-runner/engine/project-runtime.js.map +1 -0
- package/dist/lib/test-runner/engine/registry.js +95 -0
- package/dist/lib/test-runner/engine/registry.js.map +1 -0
- package/dist/lib/test-runner/engine/resource-operations.js +272 -0
- package/dist/lib/test-runner/engine/resource-operations.js.map +1 -0
- package/dist/lib/test-runner/engine/run-collected-case.js +227 -0
- package/dist/lib/test-runner/engine/run-collected-case.js.map +1 -0
- package/dist/lib/test-runner/engine/run-workflow-document.js +189 -0
- package/dist/lib/test-runner/engine/run-workflow-document.js.map +1 -0
- package/dist/lib/test-runner/engine/scheduler.js +64 -0
- package/dist/lib/test-runner/engine/scheduler.js.map +1 -0
- package/dist/lib/test-runner/engine/scope-teardown.js +50 -0
- package/dist/lib/test-runner/engine/scope-teardown.js.map +1 -0
- package/dist/lib/test-runner/engine/types.js +20 -0
- package/dist/lib/test-runner/engine/types.js.map +1 -0
- package/dist/lib/test-runner/errors.js +283 -0
- package/dist/lib/test-runner/errors.js.map +1 -0
- package/dist/lib/test-runner/execution-record.js +123 -0
- package/dist/lib/test-runner/execution-record.js.map +1 -0
- package/dist/lib/test-runner/index.js +137 -0
- package/dist/lib/test-runner/index.js.map +1 -0
- package/dist/lib/test-runner/node/define-node.js +78 -0
- package/dist/lib/test-runner/node/define-node.js.map +1 -0
- package/dist/lib/test-runner/node/index.js +67 -0
- package/dist/lib/test-runner/node/index.js.map +1 -0
- package/dist/lib/test-runner/node/types.js +20 -0
- package/dist/lib/test-runner/node/types.js.map +1 -0
- package/dist/lib/test-runner/parser/document-format.js +58 -0
- package/dist/lib/test-runner/parser/document-format.js.map +1 -0
- package/dist/lib/test-runner/parser/normalize.js +124 -0
- package/dist/lib/test-runner/parser/normalize.js.map +1 -0
- package/dist/lib/test-runner/parser/types.js +20 -0
- package/dist/lib/test-runner/parser/types.js.map +1 -0
- package/dist/lib/test-runner/project.js +20 -0
- package/dist/lib/test-runner/project.js.map +1 -0
- package/dist/lib/test-runner/reporting/agent-report.js +57 -0
- package/dist/lib/test-runner/reporting/agent-report.js.map +1 -0
- package/dist/lib/test-runner/reporting/execution-record.js +107 -0
- package/dist/lib/test-runner/reporting/execution-record.js.map +1 -0
- package/dist/lib/test-runner/reporting/merge-report.js +265 -0
- package/dist/lib/test-runner/reporting/merge-report.js.map +1 -0
- package/dist/lib/test-runner/reporting/sanitize.js +202 -0
- package/dist/lib/test-runner/reporting/sanitize.js.map +1 -0
- package/dist/lib/test-runner/reporting/test-run-report.js +364 -0
- package/dist/lib/test-runner/reporting/test-run-report.js.map +1 -0
- package/dist/lib/test-runner/reporting/types.js +20 -0
- package/dist/lib/test-runner/reporting/types.js.map +1 -0
- package/dist/lib/utils.js +1 -1
- package/dist/lib/yaml/execution-context.node.js +43 -0
- package/dist/lib/yaml/execution-context.node.js.map +1 -0
- package/dist/lib/yaml/execution-context.stub.js +45 -0
- package/dist/lib/yaml/execution-context.stub.js.map +1 -0
- package/dist/lib/yaml/execution-session.js +136 -0
- package/dist/lib/yaml/execution-session.js.map +1 -0
- package/dist/lib/yaml/index.js +49 -7
- package/dist/lib/yaml/legacy-yaml-execution-record.js +81 -0
- package/dist/lib/yaml/legacy-yaml-execution-record.js.map +1 -0
- package/dist/lib/yaml/legacy-yaml-report.js +86 -0
- package/dist/lib/yaml/legacy-yaml-report.js.map +1 -0
- package/dist/lib/yaml/legacy-yaml-runtime.js +156 -0
- package/dist/lib/yaml/legacy-yaml-runtime.js.map +1 -0
- package/dist/lib/yaml/player-state.js +52 -0
- package/dist/lib/yaml/player-state.js.map +1 -0
- package/dist/lib/yaml/player.js +213 -347
- package/dist/lib/yaml/player.js.map +1 -1
- package/dist/lib/yaml/report-policy.js +41 -0
- package/dist/lib/yaml/report-policy.js.map +1 -0
- package/dist/lib/yaml/test-runner-compat.js +344 -0
- package/dist/lib/yaml/test-runner-compat.js.map +1 -0
- package/dist/lib/yaml/test-runner-nodes.js +184 -0
- package/dist/lib/yaml/test-runner-nodes.js.map +1 -0
- package/dist/lib/yaml/utils.js +18 -1
- package/dist/lib/yaml/utils.js.map +1 -1
- package/dist/lib/yaml-runtime.js +67 -0
- package/dist/lib/yaml-runtime.js.map +1 -0
- package/dist/lib/yaml.js.map +1 -1
- package/dist/types/agent/agent.d.ts +14 -1
- package/dist/types/agent/agent.d.ts.map +1 -1
- package/dist/types/agent/index.d.ts +4 -3
- package/dist/types/agent/index.d.ts.map +1 -1
- package/dist/types/agent/tasks.d.ts +1 -1
- package/dist/types/agent/tasks.d.ts.map +1 -1
- package/dist/types/agent/test-runner-nodes.d.ts +226 -0
- package/dist/types/agent/test-runner-nodes.d.ts.map +1 -1
- package/dist/types/device/index.d.ts +1 -1
- package/dist/types/device/index.d.ts.map +1 -1
- package/dist/types/dump/html-utils.d.ts +4 -0
- package/dist/types/dump/html-utils.d.ts.map +1 -1
- package/dist/types/dump/screenshot-store.d.ts +2 -1
- package/dist/types/dump/screenshot-store.d.ts.map +1 -1
- package/dist/types/report-cli.d.ts.map +1 -1
- package/dist/types/report-generator.d.ts +10 -0
- package/dist/types/report-generator.d.ts.map +1 -1
- package/dist/types/report.d.ts +3 -1
- package/dist/types/report.d.ts.map +1 -1
- package/dist/types/test-run-report.d.ts +18 -2
- package/dist/types/test-run-report.d.ts.map +1 -1
- package/dist/types/test-runner/engine/case-runner.d.ts +13 -0
- package/dist/types/test-runner/engine/case-runner.d.ts.map +1 -0
- package/dist/types/test-runner/engine/document-runtime.d.ts +4 -0
- package/dist/types/test-runner/engine/document-runtime.d.ts.map +1 -0
- package/dist/types/test-runner/engine/execute-step.d.ts +17 -0
- package/dist/types/test-runner/engine/execute-step.d.ts.map +1 -0
- package/dist/types/test-runner/engine/execution-failure.d.ts +13 -0
- package/dist/types/test-runner/engine/execution-failure.d.ts.map +1 -0
- package/dist/types/test-runner/engine/index.d.ts +13 -0
- package/dist/types/test-runner/engine/index.d.ts.map +1 -0
- package/dist/types/test-runner/engine/project-runtime.d.ts +3 -0
- package/dist/types/test-runner/engine/project-runtime.d.ts.map +1 -0
- package/dist/types/test-runner/engine/registry.d.ts +12 -0
- package/dist/types/test-runner/engine/registry.d.ts.map +1 -0
- package/dist/types/test-runner/engine/resource-operations.d.ts +32 -0
- package/dist/types/test-runner/engine/resource-operations.d.ts.map +1 -0
- package/dist/types/test-runner/engine/run-collected-case.d.ts +4 -0
- package/dist/types/test-runner/engine/run-collected-case.d.ts.map +1 -0
- package/dist/types/test-runner/engine/run-workflow-document.d.ts +4 -0
- package/dist/types/test-runner/engine/run-workflow-document.d.ts.map +1 -0
- package/dist/types/test-runner/engine/scheduler.d.ts +12 -0
- package/dist/types/test-runner/engine/scheduler.d.ts.map +1 -0
- package/dist/types/test-runner/engine/scope-teardown.d.ts +3 -0
- package/dist/types/test-runner/engine/scope-teardown.d.ts.map +1 -0
- package/dist/types/test-runner/engine/types.d.ts +226 -0
- package/dist/types/test-runner/engine/types.d.ts.map +1 -0
- package/dist/types/test-runner/errors.d.ts +79 -0
- package/dist/types/test-runner/errors.d.ts.map +1 -0
- package/dist/types/test-runner/execution-record.d.ts +43 -0
- package/dist/types/test-runner/execution-record.d.ts.map +1 -0
- package/dist/types/test-runner/index.d.ts +20 -0
- package/dist/types/test-runner/index.d.ts.map +1 -0
- package/dist/types/test-runner/node/define-node.d.ts +4 -0
- package/dist/types/test-runner/node/define-node.d.ts.map +1 -0
- package/dist/types/test-runner/node/index.d.ts +3 -0
- package/dist/types/test-runner/node/index.d.ts.map +1 -0
- package/dist/types/test-runner/node/types.d.ts +66 -0
- package/dist/types/test-runner/node/types.d.ts.map +1 -0
- package/dist/types/test-runner/parser/document-format.d.ts +8 -0
- package/dist/types/test-runner/parser/document-format.d.ts.map +1 -0
- package/dist/types/test-runner/parser/normalize.d.ts +9 -0
- package/dist/types/test-runner/parser/normalize.d.ts.map +1 -0
- package/dist/types/test-runner/parser/types.d.ts +69 -0
- package/dist/types/test-runner/parser/types.d.ts.map +1 -0
- package/dist/types/test-runner/project.d.ts +75 -0
- package/dist/types/test-runner/project.d.ts.map +1 -0
- package/dist/types/test-runner/reporting/agent-report.d.ts +9 -0
- package/dist/types/test-runner/reporting/agent-report.d.ts.map +1 -0
- package/dist/types/test-runner/reporting/execution-record.d.ts +9 -0
- package/dist/types/test-runner/reporting/execution-record.d.ts.map +1 -0
- package/dist/types/test-runner/reporting/merge-report.d.ts +15 -0
- package/dist/types/test-runner/reporting/merge-report.d.ts.map +1 -0
- package/dist/types/test-runner/reporting/sanitize.d.ts +6 -0
- package/dist/types/test-runner/reporting/sanitize.d.ts.map +1 -0
- package/dist/types/test-runner/reporting/test-run-report.d.ts +5 -0
- package/dist/types/test-runner/reporting/test-run-report.d.ts.map +1 -0
- package/dist/types/test-runner/reporting/types.d.ts +34 -0
- package/dist/types/test-runner/reporting/types.d.ts.map +1 -0
- package/dist/types/yaml/execution-context.node.d.ts +4 -0
- package/dist/types/yaml/execution-context.node.d.ts.map +1 -0
- package/dist/types/yaml/execution-context.stub.d.ts +6 -0
- package/dist/types/yaml/execution-context.stub.d.ts.map +1 -0
- package/dist/types/yaml/execution-session.d.ts +17 -0
- package/dist/types/yaml/execution-session.d.ts.map +1 -0
- package/dist/types/yaml/index.d.ts +1 -1
- package/dist/types/yaml/index.d.ts.map +1 -1
- package/dist/types/yaml/legacy-yaml-execution-record.d.ts +24 -0
- package/dist/types/yaml/legacy-yaml-execution-record.d.ts.map +1 -0
- package/dist/types/yaml/legacy-yaml-report.d.ts +19 -0
- package/dist/types/yaml/legacy-yaml-report.d.ts.map +1 -0
- package/dist/types/yaml/legacy-yaml-runtime.d.ts +23 -0
- package/dist/types/yaml/legacy-yaml-runtime.d.ts.map +1 -0
- package/dist/types/yaml/player-state.d.ts +11 -0
- package/dist/types/yaml/player-state.d.ts.map +1 -0
- package/dist/types/yaml/player.d.ts +11 -3
- package/dist/types/yaml/player.d.ts.map +1 -1
- package/dist/types/yaml/report-policy.d.ts +4 -0
- package/dist/types/yaml/report-policy.d.ts.map +1 -0
- package/dist/types/yaml/test-runner-compat.d.ts +17 -0
- package/dist/types/yaml/test-runner-compat.d.ts.map +1 -0
- package/dist/types/yaml/test-runner-nodes.d.ts +6 -0
- package/dist/types/yaml/test-runner-nodes.d.ts.map +1 -0
- package/dist/types/yaml/utils.d.ts +9 -0
- package/dist/types/yaml/utils.d.ts.map +1 -1
- package/dist/types/yaml-runtime.d.ts +13 -0
- package/dist/types/yaml-runtime.d.ts.map +1 -0
- package/dist/types/yaml.d.ts +25 -7
- package/dist/types/yaml.d.ts.map +1 -1
- package/package.json +28 -2
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: definition[key]
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
})();
|
|
11
|
+
(()=>{
|
|
12
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
+
})();
|
|
14
|
+
(()=>{
|
|
15
|
+
__webpack_require__.r = (exports1)=>{
|
|
16
|
+
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
+
value: 'Module'
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
+
value: true
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
var __webpack_exports__ = {};
|
|
25
|
+
__webpack_require__.r(__webpack_exports__);
|
|
26
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
runWorkflowDocument: ()=>runWorkflowDocument
|
|
28
|
+
});
|
|
29
|
+
const external_document_runtime_js_namespaceObject = require("./document-runtime.js");
|
|
30
|
+
const external_execution_failure_js_namespaceObject = require("./execution-failure.js");
|
|
31
|
+
const external_run_collected_case_js_namespaceObject = require("./run-collected-case.js");
|
|
32
|
+
const asNotRun = (collectedCase, projectName, reason)=>({
|
|
33
|
+
caseId: collectedCase.caseId,
|
|
34
|
+
projectName,
|
|
35
|
+
name: collectedCase.definition.name,
|
|
36
|
+
sourcePath: collectedCase.sourcePath,
|
|
37
|
+
caseIndex: collectedCase.caseIndex,
|
|
38
|
+
...collectedCase.definition.onFailure ? {
|
|
39
|
+
onFailure: collectedCase.definition.onFailure
|
|
40
|
+
} : {},
|
|
41
|
+
status: 'not-run',
|
|
42
|
+
notRunReason: reason
|
|
43
|
+
});
|
|
44
|
+
async function runWorkflowDocument(document, options) {
|
|
45
|
+
const signal = options.signal ?? new AbortController().signal;
|
|
46
|
+
const createDocumentRunId = options.createDocumentRunId;
|
|
47
|
+
const createCaseRunId = options.createCaseRunId;
|
|
48
|
+
const projectName = options.project?.name ?? document.projectId;
|
|
49
|
+
const retry = options.retry ?? options.project?.retry ?? 0;
|
|
50
|
+
if (!Number.isInteger(retry) || retry < 0) throw new TypeError('Workflow document retry must be a non-negative integer.');
|
|
51
|
+
const runtime = (0, external_document_runtime_js_namespaceObject.createDocumentRuntime)(document, {
|
|
52
|
+
documentSetup: options.documentSetup,
|
|
53
|
+
documentAttemptIndex: options.documentAttemptIndex,
|
|
54
|
+
resolveNode: options.resolveNode,
|
|
55
|
+
project: options.project,
|
|
56
|
+
projectContext: options.projectContext,
|
|
57
|
+
signal,
|
|
58
|
+
defaultTimeoutMs: options.defaultTimeoutMs,
|
|
59
|
+
onStepStart: options.onStepStart,
|
|
60
|
+
onStepResult: options.onStepResult,
|
|
61
|
+
onResult: async (result)=>{
|
|
62
|
+
await options.documentSetup?.onDocumentResult?.(result, runtime.context);
|
|
63
|
+
await options.onDocumentResult?.(result);
|
|
64
|
+
},
|
|
65
|
+
createDocumentRunId: createDocumentRunId ? ()=>createDocumentRunId(document) : void 0
|
|
66
|
+
});
|
|
67
|
+
const cases = [];
|
|
68
|
+
let runtimeStarted = false;
|
|
69
|
+
let documentResult;
|
|
70
|
+
const executionErrors = [];
|
|
71
|
+
let fatalError = false;
|
|
72
|
+
let stoppedByCase = false;
|
|
73
|
+
try {
|
|
74
|
+
runtimeStarted = true;
|
|
75
|
+
const startedDocument = await runtime.start();
|
|
76
|
+
if (runtime.canRunCases) for (const collectedCase of document.cases){
|
|
77
|
+
if (stoppedByCase || fatalError || signal.aborted || options.shouldStop?.()) {
|
|
78
|
+
const outcome = asNotRun(collectedCase, projectName, signal.aborted ? options.stopReason?.() ?? 'interrupted' : fatalError ? 'fatal-error' : stoppedByCase ? 'bail' : options.stopReason?.() ?? 'interrupted');
|
|
79
|
+
cases.push(outcome);
|
|
80
|
+
await options.onCaseOutcome?.(outcome);
|
|
81
|
+
continue;
|
|
82
|
+
}
|
|
83
|
+
await options.onCaseStart?.(collectedCase);
|
|
84
|
+
const attempts = [];
|
|
85
|
+
for(let attemptIndex = 0; attemptIndex <= retry; attemptIndex += 1){
|
|
86
|
+
let attemptFailure;
|
|
87
|
+
const run = await (0, external_run_collected_case_js_namespaceObject.runCollectedCase)(collectedCase, {
|
|
88
|
+
resolveNode: options.resolveNode,
|
|
89
|
+
beforeEach: document.lifecycle.beforeEach,
|
|
90
|
+
afterEach: document.lifecycle.afterEach,
|
|
91
|
+
context: runtime.context,
|
|
92
|
+
projectName,
|
|
93
|
+
attemptIndex,
|
|
94
|
+
signal: runtime.signal,
|
|
95
|
+
defaultTimeoutMs: options.defaultTimeoutMs,
|
|
96
|
+
onStepStart: options.onStepStart,
|
|
97
|
+
onStepResult: options.onStepResult,
|
|
98
|
+
onResult: options.onCaseResult,
|
|
99
|
+
reportScopeId: options.resolveCaseReportScopeId?.(collectedCase, attemptIndex, startedDocument.documentRunId),
|
|
100
|
+
createRunId: createCaseRunId ? ()=>createCaseRunId(collectedCase, attemptIndex) : void 0
|
|
101
|
+
}).catch((error)=>{
|
|
102
|
+
if (!(error instanceof external_execution_failure_js_namespaceObject.WorkflowExecutionFailure)) throw error;
|
|
103
|
+
attemptFailure = error;
|
|
104
|
+
return attemptFailure.result;
|
|
105
|
+
});
|
|
106
|
+
attempts.push(run);
|
|
107
|
+
if (attemptFailure) {
|
|
108
|
+
cases.push({
|
|
109
|
+
caseId: collectedCase.caseId,
|
|
110
|
+
projectName,
|
|
111
|
+
name: collectedCase.definition.name,
|
|
112
|
+
sourcePath: collectedCase.sourcePath,
|
|
113
|
+
caseIndex: collectedCase.caseIndex,
|
|
114
|
+
...collectedCase.definition.onFailure ? {
|
|
115
|
+
onFailure: collectedCase.definition.onFailure
|
|
116
|
+
} : {},
|
|
117
|
+
status: 'failed',
|
|
118
|
+
run,
|
|
119
|
+
attempts
|
|
120
|
+
});
|
|
121
|
+
throw attemptFailure;
|
|
122
|
+
}
|
|
123
|
+
fatalError = options.isFatalError?.(run) ?? false;
|
|
124
|
+
if ('success' === run.status || !!run.teardownErrors?.length || fatalError || signal.aborted || options.shouldStop?.()) break;
|
|
125
|
+
}
|
|
126
|
+
const run = attempts.at(-1);
|
|
127
|
+
const outcome = {
|
|
128
|
+
caseId: collectedCase.caseId,
|
|
129
|
+
projectName,
|
|
130
|
+
name: collectedCase.definition.name,
|
|
131
|
+
sourcePath: collectedCase.sourcePath,
|
|
132
|
+
caseIndex: collectedCase.caseIndex,
|
|
133
|
+
...collectedCase.definition.onFailure ? {
|
|
134
|
+
onFailure: collectedCase.definition.onFailure
|
|
135
|
+
} : {},
|
|
136
|
+
status: run.status,
|
|
137
|
+
run,
|
|
138
|
+
attempts
|
|
139
|
+
};
|
|
140
|
+
cases.push(outcome);
|
|
141
|
+
stoppedByCase = 'failed' === outcome.status && 'stop-document' === collectedCase.definition.onFailure;
|
|
142
|
+
await options.onCaseOutcome?.(outcome);
|
|
143
|
+
}
|
|
144
|
+
else {
|
|
145
|
+
const reason = signal.aborted ? options.stopReason?.() ?? 'interrupted' : 'document-start-failed';
|
|
146
|
+
cases.push(...document.cases.map((collectedCase)=>asNotRun(collectedCase, projectName, reason)));
|
|
147
|
+
}
|
|
148
|
+
} catch (error) {
|
|
149
|
+
executionErrors.push(...error instanceof external_execution_failure_js_namespaceObject.WorkflowExecutionFailure ? error.errors : [
|
|
150
|
+
error
|
|
151
|
+
]);
|
|
152
|
+
} finally{
|
|
153
|
+
if (runtimeStarted) try {
|
|
154
|
+
documentResult = await runtime.finish();
|
|
155
|
+
} catch (error) {
|
|
156
|
+
if (error instanceof external_execution_failure_js_namespaceObject.WorkflowExecutionFailure) {
|
|
157
|
+
documentResult = error.result;
|
|
158
|
+
for (const failure of error.errors)if (!executionErrors.includes(failure)) executionErrors.push(failure);
|
|
159
|
+
} else executionErrors.push(error);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
if (!documentResult) {
|
|
163
|
+
if (executionErrors.length) throw new AggregateError(executionErrors, 'Workflow execution did not produce a document result.');
|
|
164
|
+
throw new Error(`Workflow document "${document.sourcePath}" did not produce a result.`);
|
|
165
|
+
}
|
|
166
|
+
if (executionErrors.length) {
|
|
167
|
+
const completed = new Set(cases.map((outcome)=>outcome.caseId));
|
|
168
|
+
cases.push(...document.cases.filter((item)=>!completed.has(item.caseId)).map((item)=>asNotRun(item, projectName, 'interrupted')));
|
|
169
|
+
documentResult.status = 'failed';
|
|
170
|
+
documentResult.executionErrors = executionErrors.map(external_execution_failure_js_namespaceObject.asExecutionError);
|
|
171
|
+
throw new external_execution_failure_js_namespaceObject.WorkflowExecutionFailure({
|
|
172
|
+
document: documentResult,
|
|
173
|
+
cases
|
|
174
|
+
}, executionErrors);
|
|
175
|
+
}
|
|
176
|
+
return {
|
|
177
|
+
document: documentResult,
|
|
178
|
+
cases
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
exports.runWorkflowDocument = __webpack_exports__.runWorkflowDocument;
|
|
182
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
183
|
+
"runWorkflowDocument"
|
|
184
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
185
|
+
Object.defineProperty(exports, '__esModule', {
|
|
186
|
+
value: true
|
|
187
|
+
});
|
|
188
|
+
|
|
189
|
+
//# sourceMappingURL=run-workflow-document.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test-runner/engine/run-workflow-document.js","sources":["webpack/runtime/define_property_getters","webpack/runtime/has_own_property","webpack/runtime/make_namespace_object","../../../../src/test-runner/engine/run-workflow-document.ts"],"sourcesContent":["__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n }\n }\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import type { CollectedCase, CollectedWorkflowDocument } from '../parser/types';\nimport { createDocumentRuntime } from './document-runtime';\nimport {\n WorkflowExecutionFailure,\n asExecutionError,\n} from './execution-failure';\nimport { runCollectedCase } from './run-collected-case';\nimport type {\n CaseRunOutcome,\n CaseRunResult,\n RunWorkflowDocumentOptions,\n WorkflowDocumentExecutionResult,\n WorkflowDocumentRunResult,\n} from './types';\n\nconst asNotRun = (\n collectedCase: CollectedCase,\n projectName: string,\n reason: NonNullable<CaseRunOutcome['notRunReason']>,\n): CaseRunOutcome => ({\n caseId: collectedCase.caseId,\n projectName,\n name: collectedCase.definition.name,\n sourcePath: collectedCase.sourcePath,\n caseIndex: collectedCase.caseIndex,\n ...(collectedCase.definition.onFailure\n ? { onFailure: collectedCase.definition.onFailure }\n : {}),\n status: 'not-run',\n notRunReason: reason,\n});\n\nexport async function runWorkflowDocument<TContext = undefined>(\n document: CollectedWorkflowDocument,\n options: RunWorkflowDocumentOptions<TContext>,\n): Promise<WorkflowDocumentExecutionResult> {\n const signal = options.signal ?? new AbortController().signal;\n const createDocumentRunId = options.createDocumentRunId;\n const createCaseRunId = options.createCaseRunId;\n const projectName = options.project?.name ?? document.projectId;\n const retry = options.retry ?? options.project?.retry ?? 0;\n if (!Number.isInteger(retry) || retry < 0) {\n throw new TypeError(\n 'Workflow document retry must be a non-negative integer.',\n );\n }\n const runtime = createDocumentRuntime(document, {\n documentSetup: options.documentSetup,\n documentAttemptIndex: options.documentAttemptIndex,\n resolveNode: options.resolveNode,\n project: options.project,\n projectContext: options.projectContext,\n signal,\n defaultTimeoutMs: options.defaultTimeoutMs,\n onStepStart: options.onStepStart,\n onStepResult: options.onStepResult,\n onResult: async (result) => {\n await options.documentSetup?.onDocumentResult?.(result, runtime.context);\n await options.onDocumentResult?.(result);\n },\n createDocumentRunId: createDocumentRunId\n ? () => createDocumentRunId(document)\n : undefined,\n });\n const cases: CaseRunOutcome[] = [];\n let runtimeStarted = false;\n let documentResult: WorkflowDocumentRunResult | undefined;\n const executionErrors: unknown[] = [];\n let fatalError = false;\n let stoppedByCase = false;\n\n try {\n runtimeStarted = true;\n const startedDocument = await runtime.start();\n\n if (!runtime.canRunCases) {\n const reason = signal.aborted\n ? (options.stopReason?.() ?? 'interrupted')\n : 'document-start-failed';\n cases.push(\n ...document.cases.map((collectedCase) =>\n asNotRun(collectedCase, projectName, reason),\n ),\n );\n } else {\n for (const collectedCase of document.cases) {\n if (\n stoppedByCase ||\n fatalError ||\n signal.aborted ||\n options.shouldStop?.()\n ) {\n const outcome = asNotRun(\n collectedCase,\n projectName,\n signal.aborted\n ? (options.stopReason?.() ?? 'interrupted')\n : fatalError\n ? 'fatal-error'\n : stoppedByCase\n ? 'bail'\n : (options.stopReason?.() ?? 'interrupted'),\n );\n cases.push(outcome);\n await options.onCaseOutcome?.(outcome);\n continue;\n }\n\n await options.onCaseStart?.(collectedCase);\n const attempts = [];\n for (let attemptIndex = 0; attemptIndex <= retry; attemptIndex += 1) {\n let attemptFailure:\n | WorkflowExecutionFailure<CaseRunResult>\n | undefined;\n const run = await runCollectedCase(collectedCase, {\n resolveNode: options.resolveNode,\n beforeEach: document.lifecycle.beforeEach,\n afterEach: document.lifecycle.afterEach,\n context: runtime.context,\n projectName,\n attemptIndex,\n signal: runtime.signal,\n defaultTimeoutMs: options.defaultTimeoutMs,\n onStepStart: options.onStepStart,\n onStepResult: options.onStepResult,\n onResult: options.onCaseResult,\n reportScopeId: options.resolveCaseReportScopeId?.(\n collectedCase,\n attemptIndex,\n startedDocument.documentRunId,\n ),\n createRunId: createCaseRunId\n ? () => createCaseRunId(collectedCase, attemptIndex)\n : undefined,\n }).catch((error: unknown) => {\n if (!(error instanceof WorkflowExecutionFailure)) throw error;\n attemptFailure = error as WorkflowExecutionFailure<CaseRunResult>;\n return attemptFailure.result;\n });\n attempts.push(run);\n if (attemptFailure) {\n cases.push({\n caseId: collectedCase.caseId,\n projectName,\n name: collectedCase.definition.name,\n sourcePath: collectedCase.sourcePath,\n caseIndex: collectedCase.caseIndex,\n ...(collectedCase.definition.onFailure\n ? { onFailure: collectedCase.definition.onFailure }\n : {}),\n status: 'failed',\n run,\n attempts,\n });\n throw attemptFailure;\n }\n fatalError = options.isFatalError?.(run) ?? false;\n if (\n run.status === 'success' ||\n // Retrying cannot repair cleanup/report publication and would\n // replay actions that may already have completed successfully.\n !!run.teardownErrors?.length ||\n fatalError ||\n signal.aborted ||\n options.shouldStop?.()\n )\n break;\n }\n const run = attempts.at(-1)!;\n const outcome: CaseRunOutcome = {\n caseId: collectedCase.caseId,\n projectName,\n name: collectedCase.definition.name,\n sourcePath: collectedCase.sourcePath,\n caseIndex: collectedCase.caseIndex,\n ...(collectedCase.definition.onFailure\n ? { onFailure: collectedCase.definition.onFailure }\n : {}),\n status: run.status,\n run,\n attempts,\n };\n cases.push(outcome);\n stoppedByCase =\n outcome.status === 'failed' &&\n collectedCase.definition.onFailure === 'stop-document';\n await options.onCaseOutcome?.(outcome);\n }\n }\n } catch (error) {\n executionErrors.push(\n ...(error instanceof WorkflowExecutionFailure ? error.errors : [error]),\n );\n } finally {\n if (runtimeStarted) {\n try {\n documentResult = await runtime.finish();\n } catch (error) {\n if (error instanceof WorkflowExecutionFailure) {\n documentResult = error.result as WorkflowDocumentRunResult;\n for (const failure of error.errors)\n if (!executionErrors.includes(failure))\n executionErrors.push(failure);\n } else executionErrors.push(error);\n }\n }\n }\n\n if (!documentResult) {\n if (executionErrors.length)\n throw new AggregateError(\n executionErrors,\n 'Workflow execution did not produce a document result.',\n );\n throw new Error(\n `Workflow document \"${document.sourcePath}\" did not produce a result.`,\n );\n }\n if (executionErrors.length) {\n const completed = new Set(cases.map((outcome) => outcome.caseId));\n cases.push(\n ...document.cases\n .filter((item) => !completed.has(item.caseId))\n .map((item) => asNotRun(item, projectName, 'interrupted')),\n );\n documentResult.status = 'failed';\n documentResult.executionErrors = executionErrors.map(asExecutionError);\n throw new WorkflowExecutionFailure(\n { document: documentResult, cases },\n executionErrors,\n );\n }\n return { document: documentResult, cases };\n}\n"],"names":["__webpack_require__","definition","key","Object","obj","prop","Symbol","asNotRun","collectedCase","projectName","reason","runWorkflowDocument","document","options","signal","AbortController","createDocumentRunId","createCaseRunId","retry","Number","TypeError","runtime","createDocumentRuntime","result","undefined","cases","runtimeStarted","documentResult","executionErrors","fatalError","stoppedByCase","startedDocument","outcome","attempts","attemptIndex","attemptFailure","run","runCollectedCase","error","WorkflowExecutionFailure","failure","AggregateError","Error","completed","Set","item","asExecutionError"],"mappings":";;;IAAAA,oBAAoB,CAAC,GAAG,CAAC,UAASC;QACjC,IAAI,IAAIC,OAAOD,WACR,IAAGD,oBAAoB,CAAC,CAACC,YAAYC,QAAQ,CAACF,oBAAoB,CAAC,CAAC,UAASE,MACzEC,OAAO,cAAc,CAAC,UAASD,KAAK;YAAE,YAAY;YAAM,KAAKD,UAAU,CAACC,IAAI;QAAC;IAGzF;;;ICNAF,oBAAoB,CAAC,GAAG,CAACI,KAAKC,OAAUF,OAAO,SAAS,CAAC,cAAc,CAAC,IAAI,CAACC,KAAKC;;;ICClFL,oBAAoB,CAAC,GAAG,CAAC;QACxB,IAAG,AAAkB,eAAlB,OAAOM,UAA0BA,OAAO,WAAW,EACrDH,OAAO,cAAc,CAAC,UAASG,OAAO,WAAW,EAAE;YAAE,OAAO;QAAS;QAEtEH,OAAO,cAAc,CAAC,UAAS,cAAc;YAAE,OAAO;QAAK;IAC5D;;;;;;;;;;ACSA,MAAMI,WAAW,CACfC,eACAC,aACAC,SACoB;QACpB,QAAQF,cAAc,MAAM;QAC5BC;QACA,MAAMD,c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C,8CAAAA,wBAAwBA,GAAGD,MAAM,MAAM,GAAG;YAACA;SAAM;IAE1E,SAAU;QACR,IAAIZ,gBACF,IAAI;YACFC,iBAAiB,MAAMN,QAAQ,MAAM;QACvC,EAAE,OAAOiB,OAAO;YACd,IAAIA,iBAAiBC,8CAAAA,wBAAwBA,EAAE;gBAC7CZ,iBAAiBW,MAAM,MAAM;gBAC7B,KAAK,MAAME,WAAWF,MAAM,MAAM,CAChC,IAAI,CAACV,gBAAgB,QAAQ,CAACY,UAC5BZ,gBAAgB,IAAI,CAACY;YAC3B,OAAOZ,gBAAgB,IAAI,CAACU;QAC9B;IAEJ;IAEA,IAAI,CAACX,gBAAgB;QACnB,IAAIC,gBAAgB,MAAM,EACxB,MAAM,IAAIa,eACRb,iBACA;QAEJ,MAAM,IAAIc,MACR,CAAC,mBAAmB,EAAE9B,SAAS,UAAU,CAAC,2BAA2B,CAAC;IAE1E;IACA,IAAIgB,gBAAgB,MAAM,EAAE;QAC1B,MAAMe,YAAY,IAAIC,IAAInB,MAAM,GAAG,CAAC,CAACO,UAAYA,QAAQ,MAAM;QAC/DP,MAAM,IAAI,IACLb,SAAS,KAAK,CACd,MAAM,CAAC,CAACiC,OAAS,CAACF,UAAU,GAAG,CAACE,KAAK,MAAM,GAC3C,GAAG,CAAC,CAACA,OAAStC,SAASsC,MAAMpC,aAAa;QAE/CkB,eAAe,MAAM,GAAG;QACxBA,eAAe,eAAe,GAAGC,gBAAgB,GAAG,CAACkB,8CAAAA,gBAAgBA;QACrE,MAAM,IAAIP,8CAAAA,wBAAwBA,CAChC;YAAE,UAAUZ;YAAgBF;QAAM,GAClCG;IAEJ;IACA,OAAO;QAAE,UAAUD;QAAgBF;IAAM;AAC3C"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: definition[key]
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
})();
|
|
11
|
+
(()=>{
|
|
12
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
+
})();
|
|
14
|
+
(()=>{
|
|
15
|
+
__webpack_require__.r = (exports1)=>{
|
|
16
|
+
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
+
value: 'Module'
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
+
value: true
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
var __webpack_exports__ = {};
|
|
25
|
+
__webpack_require__.r(__webpack_exports__);
|
|
26
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
runConcurrentJobs: ()=>runConcurrentJobs,
|
|
28
|
+
runDocumentAttempts: ()=>runDocumentAttempts
|
|
29
|
+
});
|
|
30
|
+
async function runDocumentAttempts(options, run) {
|
|
31
|
+
for(let attemptIndex = 0; attemptIndex <= options.retry; attemptIndex++){
|
|
32
|
+
if (options.signal.aborted || options.shouldStop()) return;
|
|
33
|
+
const status = await run(attemptIndex);
|
|
34
|
+
if ('failed' !== status) return;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
async function runConcurrentJobs(items, options, run) {
|
|
38
|
+
let next = 0;
|
|
39
|
+
const worker = async ()=>{
|
|
40
|
+
while(next < items.length && !options.shouldStop()){
|
|
41
|
+
const index = next++;
|
|
42
|
+
await run(items[index], index);
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
const workers = await Promise.allSettled(Array.from({
|
|
46
|
+
length: Math.min(options.concurrency, items.length)
|
|
47
|
+
}, worker));
|
|
48
|
+
const errors = workers.flatMap((result)=>'rejected' === result.status ? [
|
|
49
|
+
result.reason
|
|
50
|
+
] : []);
|
|
51
|
+
if (1 === errors.length) throw errors[0];
|
|
52
|
+
if (errors.length) throw new AggregateError(errors, 'Document scheduling failed');
|
|
53
|
+
}
|
|
54
|
+
exports.runConcurrentJobs = __webpack_exports__.runConcurrentJobs;
|
|
55
|
+
exports.runDocumentAttempts = __webpack_exports__.runDocumentAttempts;
|
|
56
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
57
|
+
"runConcurrentJobs",
|
|
58
|
+
"runDocumentAttempts"
|
|
59
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
60
|
+
Object.defineProperty(exports, '__esModule', {
|
|
61
|
+
value: true
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
//# sourceMappingURL=scheduler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test-runner/engine/scheduler.js","sources":["webpack/runtime/define_property_getters","webpack/runtime/has_own_property","webpack/runtime/make_namespace_object","../../../../src/test-runner/engine/scheduler.ts"],"sourcesContent":["__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n }\n }\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","/** A rejected attempt is an infrastructure failure and is never replayed. */\nexport async function runDocumentAttempts(\n options: { retry: number; signal: AbortSignal; shouldStop(): boolean },\n run: (attemptIndex: number) => Promise<'success' | 'failed' | undefined>,\n): Promise<void> {\n for (let attemptIndex = 0; attemptIndex <= options.retry; attemptIndex++) {\n if (options.signal.aborted || options.shouldStop()) return;\n const status = await run(attemptIndex);\n if (status !== 'failed') return;\n }\n}\n\n/** Ordered admission, bounded concurrency, results in invocation order. */\nexport async function runConcurrentJobs<T>(\n items: readonly T[],\n options: { concurrency: number; shouldStop(): boolean },\n run: (item: T, index: number) => Promise<void>,\n): Promise<void> {\n let next = 0;\n const worker = async () => {\n while (next < items.length && !options.shouldStop()) {\n const index = next++;\n await run(items[index], index);\n }\n };\n const workers = await Promise.allSettled(\n Array.from({ length: Math.min(options.concurrency, items.length) }, worker),\n );\n const errors = workers.flatMap((result) =>\n result.status === 'rejected' ? [result.reason] : [],\n );\n if (errors.length === 1) throw errors[0];\n if (errors.length)\n throw new AggregateError(errors, 'Document scheduling failed');\n}\n"],"names":["__webpack_require__","definition","key","Object","obj","prop","Symbol","runDocumentAttempts","options","run","attemptIndex","status","runConcurrentJobs","items","next","worker","index","workers","Promise","Array","Math","errors","result","AggregateError"],"mappings":";;;IAAAA,oBAAoB,CAAC,GAAG,CAAC,UAASC;QACjC,IAAI,IAAIC,OAAOD,WACR,IAAGD,oBAAoB,CAAC,CAACC,YAAYC,QAAQ,CAACF,oBAAoB,CAAC,CAAC,UAASE,MACzEC,OAAO,cAAc,CAAC,UAASD,KAAK;YAAE,YAAY;YAAM,KAAKD,UAAU,CAACC,IAAI;QAAC;IAGzF;;;ICNAF,oBAAoB,CAAC,GAAG,CAACI,KAAKC,OAAUF,OAAO,SAAS,CAAC,cAAc,CAAC,IAAI,CAACC,KAAKC;;;ICClFL,oBAAoB,CAAC,GAAG,CAAC;QACxB,IAAG,AAAkB,eAAlB,OAAOM,UAA0BA,OAAO,WAAW,EACrDH,OAAO,cAAc,CAAC,UAASG,OAAO,WAAW,EAAE;YAAE,OAAO;QAAS;QAEtEH,OAAO,cAAc,CAAC,UAAS,cAAc;YAAE,OAAO;QAAK;IAC5D;;;;;;;;ACLO,eAAeI,oBACpBC,OAAsE,EACtEC,GAAwE;IAExE,IAAK,IAAIC,eAAe,GAAGA,gBAAgBF,QAAQ,KAAK,EAAEE,eAAgB;QACxE,IAAIF,QAAQ,MAAM,CAAC,OAAO,IAAIA,QAAQ,UAAU,IAAI;QACpD,MAAMG,SAAS,MAAMF,IAAIC;QACzB,IAAIC,AAAW,aAAXA,QAAqB;IAC3B;AACF;AAGO,eAAeC,kBACpBC,KAAmB,EACnBL,OAAuD,EACvDC,GAA8C;IAE9C,IAAIK,OAAO;IACX,MAAMC,SAAS;QACb,MAAOD,OAAOD,MAAM,MAAM,IAAI,CAACL,QAAQ,UAAU,GAAI;YACnD,MAAMQ,QAAQF;YACd,MAAML,IAAII,KAAK,CAACG,MAAM,EAAEA;QAC1B;IACF;IACA,MAAMC,UAAU,MAAMC,QAAQ,UAAU,CACtCC,MAAM,IAAI,CAAC;QAAE,QAAQC,KAAK,GAAG,CAACZ,QAAQ,WAAW,EAAEK,MAAM,MAAM;IAAE,GAAGE;IAEtE,MAAMM,SAASJ,QAAQ,OAAO,CAAC,CAACK,SAC9BA,AAAkB,eAAlBA,OAAO,MAAM,GAAkB;YAACA,OAAO,MAAM;SAAC,GAAG,EAAE;IAErD,IAAID,AAAkB,MAAlBA,OAAO,MAAM,EAAQ,MAAMA,MAAM,CAAC,EAAE;IACxC,IAAIA,OAAO,MAAM,EACf,MAAM,IAAIE,eAAeF,QAAQ;AACrC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: definition[key]
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
})();
|
|
11
|
+
(()=>{
|
|
12
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
+
})();
|
|
14
|
+
(()=>{
|
|
15
|
+
__webpack_require__.r = (exports1)=>{
|
|
16
|
+
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
+
value: 'Module'
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
+
value: true
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
var __webpack_exports__ = {};
|
|
25
|
+
__webpack_require__.r(__webpack_exports__);
|
|
26
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
reportPathsFromTeardown: ()=>reportPathsFromTeardown
|
|
28
|
+
});
|
|
29
|
+
const external_node_path_namespaceObject = require("node:path");
|
|
30
|
+
const reportPathsFromTeardown = (result)=>{
|
|
31
|
+
if (void 0 === result) return [];
|
|
32
|
+
if ('object' != typeof result || null === result || Array.isArray(result)) throw new TypeError('Node teardown result must be an object or undefined.');
|
|
33
|
+
const paths = result.reportPaths;
|
|
34
|
+
if (void 0 === paths) return [];
|
|
35
|
+
if (!Array.isArray(paths)) throw new TypeError('Node teardown reportPaths must be an array.');
|
|
36
|
+
return paths.map((path, index)=>{
|
|
37
|
+
if ('string' != typeof path || 0 === path.trim().length) throw new TypeError(`Node teardown reportPaths[${index}] must be a non-empty string.`);
|
|
38
|
+
if (!(0, external_node_path_namespaceObject.isAbsolute)(path)) throw new TypeError(`Node teardown reportPaths[${index}] must be an absolute path.`);
|
|
39
|
+
return path;
|
|
40
|
+
});
|
|
41
|
+
};
|
|
42
|
+
exports.reportPathsFromTeardown = __webpack_exports__.reportPathsFromTeardown;
|
|
43
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
44
|
+
"reportPathsFromTeardown"
|
|
45
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
46
|
+
Object.defineProperty(exports, '__esModule', {
|
|
47
|
+
value: true
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
//# sourceMappingURL=scope-teardown.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test-runner/engine/scope-teardown.js","sources":["webpack/runtime/define_property_getters","webpack/runtime/has_own_property","webpack/runtime/make_namespace_object","../../../../src/test-runner/engine/scope-teardown.ts"],"sourcesContent":["__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n }\n }\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import { isAbsolute } from 'node:path';\nimport type { NodeScopeTeardownResult } from './types';\n\nexport const reportPathsFromTeardown = (\n // biome-ignore lint/suspicious/noConfusingVoidType: this consumes the intentional void teardown return.\n result: NodeScopeTeardownResult | void,\n): readonly string[] => {\n if (result === undefined) return [];\n if (typeof result !== 'object' || result === null || Array.isArray(result)) {\n throw new TypeError('Node teardown result must be an object or undefined.');\n }\n const paths = result.reportPaths;\n if (paths === undefined) return [];\n if (!Array.isArray(paths)) {\n throw new TypeError('Node teardown reportPaths must be an array.');\n }\n return paths.map((path, index) => {\n if (typeof path !== 'string' || path.trim().length === 0) {\n throw new TypeError(\n `Node teardown reportPaths[${index}] must be a non-empty string.`,\n );\n }\n if (!isAbsolute(path)) {\n throw new TypeError(\n `Node teardown reportPaths[${index}] must be an absolute path.`,\n );\n }\n return path;\n });\n};\n"],"names":["__webpack_require__","definition","key","Object","obj","prop","Symbol","reportPathsFromTeardown","result","undefined","Array","TypeError","paths","path","index","isAbsolute"],"mappings":";;;IAAAA,oBAAoB,CAAC,GAAG,CAAC,UAASC;QACjC,IAAI,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ict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.r = (exports1)=>{
|
|
5
|
+
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
6
|
+
value: 'Module'
|
|
7
|
+
});
|
|
8
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
9
|
+
value: true
|
|
10
|
+
});
|
|
11
|
+
};
|
|
12
|
+
})();
|
|
13
|
+
var __webpack_exports__ = {};
|
|
14
|
+
__webpack_require__.r(__webpack_exports__);
|
|
15
|
+
for(var __rspack_i in __webpack_exports__)exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
16
|
+
Object.defineProperty(exports, '__esModule', {
|
|
17
|
+
value: true
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test-runner/engine/types.js","sources":["webpack/runtime/make_namespace_object"],"sourcesContent":["// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};"],"names":["__webpack_require__","Symbol","Object"],"mappings":";;;IACAA,oBAAoB,CAAC,GAAG,CAAC;QACxB,IAAG,AAAkB,eAAlB,OAAOC,UAA0BA,OAAO,WAAW,EACrDC,OAAO,cAAc,CAAC,UAASD,OAAO,WAAW,EAAE;YAAE,OAAO;QAAS;QAEtEC,OAAO,cAAc,CAAC,UAAS,cAAc;YAAE,OAAO;QAAK;IAC5D"}
|
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: definition[key]
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
})();
|
|
11
|
+
(()=>{
|
|
12
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
+
})();
|
|
14
|
+
(()=>{
|
|
15
|
+
__webpack_require__.r = (exports1)=>{
|
|
16
|
+
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
+
value: 'Module'
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
+
value: true
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
var __webpack_exports__ = {};
|
|
25
|
+
__webpack_require__.r(__webpack_exports__);
|
|
26
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
CaseExecutionError: ()=>CaseExecutionError,
|
|
28
|
+
DuplicateNodeError: ()=>DuplicateNodeError,
|
|
29
|
+
FatalDeviceError: ()=>FatalDeviceError,
|
|
30
|
+
NodeDefinitionError: ()=>NodeDefinitionError,
|
|
31
|
+
NodeExecutionError: ()=>NodeExecutionError,
|
|
32
|
+
NodeInputValidationError: ()=>NodeInputValidationError,
|
|
33
|
+
NodeNotFoundError: ()=>NodeNotFoundError,
|
|
34
|
+
NodeScopeTeardownError: ()=>NodeScopeTeardownError,
|
|
35
|
+
ProjectSetupError: ()=>ProjectSetupError,
|
|
36
|
+
ProjectTeardownError: ()=>ProjectTeardownError,
|
|
37
|
+
StepTimeoutError: ()=>StepTimeoutError,
|
|
38
|
+
WorkflowDocumentExecutionError: ()=>WorkflowDocumentExecutionError,
|
|
39
|
+
WorkflowError: ()=>WorkflowError,
|
|
40
|
+
WorkflowLifecycleError: ()=>WorkflowLifecycleError,
|
|
41
|
+
WorkflowParseError: ()=>WorkflowParseError,
|
|
42
|
+
isFatalDeviceError: ()=>isFatalDeviceError,
|
|
43
|
+
normalizeNodeExecutionError: ()=>normalizeNodeExecutionError
|
|
44
|
+
});
|
|
45
|
+
function _define_property(obj, key, value) {
|
|
46
|
+
if (key in obj) Object.defineProperty(obj, key, {
|
|
47
|
+
value: value,
|
|
48
|
+
enumerable: true,
|
|
49
|
+
configurable: true,
|
|
50
|
+
writable: true
|
|
51
|
+
});
|
|
52
|
+
else obj[key] = value;
|
|
53
|
+
return obj;
|
|
54
|
+
}
|
|
55
|
+
class WorkflowError extends Error {
|
|
56
|
+
toJSON() {
|
|
57
|
+
return {
|
|
58
|
+
name: this.name,
|
|
59
|
+
message: this.message,
|
|
60
|
+
code: this.code,
|
|
61
|
+
...void 0 === this.details ? {} : {
|
|
62
|
+
details: this.details
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
constructor(message, options = {}){
|
|
67
|
+
super(message, {
|
|
68
|
+
cause: options.cause
|
|
69
|
+
}), _define_property(this, "code", void 0), _define_property(this, "details", void 0);
|
|
70
|
+
this.name = new.target.name;
|
|
71
|
+
this.code = options.code ?? 'WORKFLOW_ERROR';
|
|
72
|
+
this.details = options.details;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
class WorkflowParseError extends WorkflowError {
|
|
76
|
+
constructor(message, details, cause){
|
|
77
|
+
super(message, {
|
|
78
|
+
code: 'WORKFLOW_PARSE_ERROR',
|
|
79
|
+
details,
|
|
80
|
+
cause
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
class NodeDefinitionError extends WorkflowError {
|
|
85
|
+
constructor(message, details){
|
|
86
|
+
super(message, {
|
|
87
|
+
code: 'NODE_DEFINITION_ERROR',
|
|
88
|
+
details
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
class DuplicateNodeError extends WorkflowError {
|
|
93
|
+
constructor(node){
|
|
94
|
+
super(`Node "${node}" is already registered.`, {
|
|
95
|
+
code: 'DUPLICATE_NODE',
|
|
96
|
+
details: {
|
|
97
|
+
node
|
|
98
|
+
}
|
|
99
|
+
}), _define_property(this, "node", void 0);
|
|
100
|
+
this.node = node;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
class NodeNotFoundError extends WorkflowError {
|
|
104
|
+
constructor(node){
|
|
105
|
+
super(`Node "${node}" is not registered.`, {
|
|
106
|
+
code: 'NODE_NOT_FOUND',
|
|
107
|
+
details: {
|
|
108
|
+
node
|
|
109
|
+
}
|
|
110
|
+
}), _define_property(this, "node", void 0);
|
|
111
|
+
this.node = node;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
class NodeInputValidationError extends WorkflowError {
|
|
115
|
+
static fromZod(node, error) {
|
|
116
|
+
const issues = error.issues.map((issue)=>({
|
|
117
|
+
code: issue.code,
|
|
118
|
+
path: issue.path.map(String).join('.'),
|
|
119
|
+
message: issue.message
|
|
120
|
+
}));
|
|
121
|
+
const firstIssue = issues[0];
|
|
122
|
+
const path = firstIssue?.path || '<root>';
|
|
123
|
+
const message = firstIssue?.message ?? 'invalid input';
|
|
124
|
+
return new NodeInputValidationError(`Node "${node}" input validation failed at "${path}": ${message}`, {
|
|
125
|
+
node,
|
|
126
|
+
issues
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
constructor(message, details){
|
|
130
|
+
super(message, {
|
|
131
|
+
code: 'NODE_INPUT_VALIDATION_ERROR',
|
|
132
|
+
details
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
class StepTimeoutError extends WorkflowError {
|
|
137
|
+
constructor(timeoutMs, node){
|
|
138
|
+
super(node ? `Node "${node}" timed out after ${timeoutMs}ms.` : `Step timed out after ${timeoutMs}ms.`, {
|
|
139
|
+
code: 'STEP_TIMEOUT',
|
|
140
|
+
details: {
|
|
141
|
+
timeoutMs,
|
|
142
|
+
...void 0 === node ? {} : {
|
|
143
|
+
node
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}), _define_property(this, "timeoutMs", void 0), _define_property(this, "node", void 0);
|
|
147
|
+
this.timeoutMs = timeoutMs;
|
|
148
|
+
this.node = node;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
class NodeExecutionError extends WorkflowError {
|
|
152
|
+
constructor(node, cause, output){
|
|
153
|
+
const causeMessage = cause instanceof Error ? cause.message : String(cause ?? 'Unknown error');
|
|
154
|
+
super(`Node "${node}" failed: ${causeMessage}`, {
|
|
155
|
+
code: 'NODE_EXECUTION_ERROR',
|
|
156
|
+
details: {
|
|
157
|
+
node
|
|
158
|
+
},
|
|
159
|
+
cause
|
|
160
|
+
}), _define_property(this, "output", void 0), _define_property(this, "node", void 0), this.output = output;
|
|
161
|
+
this.node = node;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
class WorkflowLifecycleError extends WorkflowError {
|
|
165
|
+
constructor(message, details){
|
|
166
|
+
super(message, {
|
|
167
|
+
code: 'WORKFLOW_LIFECYCLE_ERROR',
|
|
168
|
+
details
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
class ProjectSetupError extends WorkflowError {
|
|
173
|
+
constructor(cause, details){
|
|
174
|
+
const causeMessage = cause instanceof Error ? cause.message : String(cause ?? 'Unknown error');
|
|
175
|
+
super(`Project "${details.projectName}" setup failed: ${causeMessage}`, {
|
|
176
|
+
code: 'PROJECT_SETUP_ERROR',
|
|
177
|
+
details,
|
|
178
|
+
cause
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
class ProjectTeardownError extends WorkflowError {
|
|
183
|
+
constructor(cause, details){
|
|
184
|
+
const causeMessage = cause instanceof Error ? cause.message : String(cause ?? 'Unknown error');
|
|
185
|
+
super(`Project "${details.projectName}" teardown failed: ${causeMessage}`, {
|
|
186
|
+
code: 'PROJECT_TEARDOWN_ERROR',
|
|
187
|
+
details,
|
|
188
|
+
cause
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
class NodeScopeTeardownError extends WorkflowError {
|
|
193
|
+
constructor(cause, details){
|
|
194
|
+
const causeMessage = cause instanceof Error ? cause.message : String(cause ?? 'Unknown error');
|
|
195
|
+
super(`${'case' === details.scope ? 'Case attempt' : 'Workflow document'} node teardown failed for "${details.node}": ${causeMessage}`, {
|
|
196
|
+
code: 'NODE_SCOPE_TEARDOWN_ERROR',
|
|
197
|
+
details,
|
|
198
|
+
cause
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
class FatalDeviceError extends WorkflowError {
|
|
203
|
+
constructor(message, cause){
|
|
204
|
+
super(message, {
|
|
205
|
+
code: 'FATAL_DEVICE_ERROR',
|
|
206
|
+
cause
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
const isFatalDeviceError = (error)=>{
|
|
211
|
+
if (error instanceof FatalDeviceError) return true;
|
|
212
|
+
if (error instanceof WorkflowError && 'FATAL_DEVICE_ERROR' === error.code) return true;
|
|
213
|
+
if (error instanceof Error && /device offline|device not found|(?:adb|bdc|device) connection (?:was )?closed/i.test(error.message)) return true;
|
|
214
|
+
return error instanceof Error && void 0 !== error.cause ? isFatalDeviceError(error.cause) : false;
|
|
215
|
+
};
|
|
216
|
+
class CaseExecutionError extends WorkflowError {
|
|
217
|
+
constructor(result){
|
|
218
|
+
super(`Case "${result.name}" failed.`, {
|
|
219
|
+
code: 'CASE_EXECUTION_FAILED',
|
|
220
|
+
details: {
|
|
221
|
+
caseId: result.caseId,
|
|
222
|
+
runId: result.runId
|
|
223
|
+
}
|
|
224
|
+
}), _define_property(this, "result", void 0);
|
|
225
|
+
this.result = result;
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
class WorkflowDocumentExecutionError extends WorkflowError {
|
|
229
|
+
constructor(result){
|
|
230
|
+
super(`Workflow document "${result.sourcePath}" failed.`, {
|
|
231
|
+
code: 'WORKFLOW_DOCUMENT_EXECUTION_FAILED',
|
|
232
|
+
details: {
|
|
233
|
+
documentId: result.documentId,
|
|
234
|
+
documentRunId: result.documentRunId
|
|
235
|
+
}
|
|
236
|
+
}), _define_property(this, "result", void 0);
|
|
237
|
+
this.result = result;
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
function normalizeNodeExecutionError(error, node) {
|
|
241
|
+
return error instanceof WorkflowError ? error : new NodeExecutionError(node, error);
|
|
242
|
+
}
|
|
243
|
+
exports.CaseExecutionError = __webpack_exports__.CaseExecutionError;
|
|
244
|
+
exports.DuplicateNodeError = __webpack_exports__.DuplicateNodeError;
|
|
245
|
+
exports.FatalDeviceError = __webpack_exports__.FatalDeviceError;
|
|
246
|
+
exports.NodeDefinitionError = __webpack_exports__.NodeDefinitionError;
|
|
247
|
+
exports.NodeExecutionError = __webpack_exports__.NodeExecutionError;
|
|
248
|
+
exports.NodeInputValidationError = __webpack_exports__.NodeInputValidationError;
|
|
249
|
+
exports.NodeNotFoundError = __webpack_exports__.NodeNotFoundError;
|
|
250
|
+
exports.NodeScopeTeardownError = __webpack_exports__.NodeScopeTeardownError;
|
|
251
|
+
exports.ProjectSetupError = __webpack_exports__.ProjectSetupError;
|
|
252
|
+
exports.ProjectTeardownError = __webpack_exports__.ProjectTeardownError;
|
|
253
|
+
exports.StepTimeoutError = __webpack_exports__.StepTimeoutError;
|
|
254
|
+
exports.WorkflowDocumentExecutionError = __webpack_exports__.WorkflowDocumentExecutionError;
|
|
255
|
+
exports.WorkflowError = __webpack_exports__.WorkflowError;
|
|
256
|
+
exports.WorkflowLifecycleError = __webpack_exports__.WorkflowLifecycleError;
|
|
257
|
+
exports.WorkflowParseError = __webpack_exports__.WorkflowParseError;
|
|
258
|
+
exports.isFatalDeviceError = __webpack_exports__.isFatalDeviceError;
|
|
259
|
+
exports.normalizeNodeExecutionError = __webpack_exports__.normalizeNodeExecutionError;
|
|
260
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
261
|
+
"CaseExecutionError",
|
|
262
|
+
"DuplicateNodeError",
|
|
263
|
+
"FatalDeviceError",
|
|
264
|
+
"NodeDefinitionError",
|
|
265
|
+
"NodeExecutionError",
|
|
266
|
+
"NodeInputValidationError",
|
|
267
|
+
"NodeNotFoundError",
|
|
268
|
+
"NodeScopeTeardownError",
|
|
269
|
+
"ProjectSetupError",
|
|
270
|
+
"ProjectTeardownError",
|
|
271
|
+
"StepTimeoutError",
|
|
272
|
+
"WorkflowDocumentExecutionError",
|
|
273
|
+
"WorkflowError",
|
|
274
|
+
"WorkflowLifecycleError",
|
|
275
|
+
"WorkflowParseError",
|
|
276
|
+
"isFatalDeviceError",
|
|
277
|
+
"normalizeNodeExecutionError"
|
|
278
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
279
|
+
Object.defineProperty(exports, '__esModule', {
|
|
280
|
+
value: true
|
|
281
|
+
});
|
|
282
|
+
|
|
283
|
+
//# sourceMappingURL=errors.js.map
|