@midscene/test 1.13.2 → 1.13.3
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/cli/index.mjs +25 -6
- package/dist/es/cli/index.mjs.map +1 -1
- package/dist/es/test-cli.mjs +26 -7
- package/dist/es/test-cli.mjs.map +1 -1
- package/dist/lib/cli/index.js +24 -5
- package/dist/lib/cli/index.js.map +1 -1
- package/dist/lib/test-cli.js +25 -6
- package/dist/lib/test-cli.js.map +1 -1
- package/dist/types/cli/index.d.ts +3 -0
- package/package.json +13 -13
package/dist/lib/cli/index.js
CHANGED
|
@@ -1046,13 +1046,32 @@ const asNotRun = (documentId, collectedCase, projectName, reason)=>({
|
|
|
1046
1046
|
notRunReason: reason
|
|
1047
1047
|
});
|
|
1048
1048
|
const summarize = (projects)=>{
|
|
1049
|
-
const
|
|
1049
|
+
const healthCases = projects.flatMap((project)=>{
|
|
1050
|
+
const documentAttemptByRunId = new Map(project.documents.map((document)=>[
|
|
1051
|
+
document.documentRunId,
|
|
1052
|
+
document.attemptIndex ?? 0
|
|
1053
|
+
]));
|
|
1054
|
+
return latestById(project.cases, (item)=>item.caseId).map((item)=>({
|
|
1055
|
+
status: item.status,
|
|
1056
|
+
...item.run ? {
|
|
1057
|
+
run: item.run
|
|
1058
|
+
} : {},
|
|
1059
|
+
...item.attempts ? {
|
|
1060
|
+
attempts: item.attempts
|
|
1061
|
+
} : {},
|
|
1062
|
+
retryCount: item.documentRunId ? documentAttemptByRunId.get(item.documentRunId) ?? 0 : 0
|
|
1063
|
+
}));
|
|
1064
|
+
});
|
|
1050
1065
|
const documents = projects.flatMap((project)=>latestById(project.documents, (item)=>item.documentId));
|
|
1066
|
+
const health = (0, report_namespaceObject.calculateTestRunHealth)(healthCases);
|
|
1051
1067
|
return {
|
|
1052
|
-
total:
|
|
1053
|
-
passed:
|
|
1054
|
-
failed:
|
|
1055
|
-
notRun:
|
|
1068
|
+
total: health.total,
|
|
1069
|
+
passed: health.passed,
|
|
1070
|
+
failed: health.failed,
|
|
1071
|
+
notRun: health.notRun,
|
|
1072
|
+
passedAfterRetry: health.passedAfterRetry,
|
|
1073
|
+
finalPassRate: health.finalPassRate,
|
|
1074
|
+
firstPassRate: health.firstPassRate,
|
|
1056
1075
|
filtered: projects.reduce((total, project)=>total + project.filteredCaseCount, 0),
|
|
1057
1076
|
collectionErrors: projects.reduce((total, project)=>total + project.collectionErrors.length, 0),
|
|
1058
1077
|
documentFailures: documents.filter((document)=>'failed' === document.status).length,
|