simplify3x-connect 0.31.9 → 0.31.10
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/assets/tessdata/eng.traineddata +0 -0
- package/dist/adapters/remoteMcp/adapter.d.ts +1 -1
- package/dist/adapters/remoteMcp/adapter.d.ts.map +1 -1
- package/dist/adapters/remoteMcp/adapter.js +6 -5
- package/dist/adapters/remoteMcp/adapter.js.map +1 -1
- package/dist/adapters/simplifyqa/adapter.d.ts +27 -1
- package/dist/adapters/simplifyqa/adapter.d.ts.map +1 -1
- package/dist/adapters/simplifyqa/adapter.js +184 -21
- package/dist/adapters/simplifyqa/adapter.js.map +1 -1
- package/dist/adapters/simplifyqa/appProfile.d.ts +25 -0
- package/dist/adapters/simplifyqa/appProfile.d.ts.map +1 -0
- package/dist/adapters/simplifyqa/appProfile.js +137 -0
- package/dist/adapters/simplifyqa/appProfile.js.map +1 -0
- package/dist/adapters/simplifyqa/executionFailures.d.ts +53 -11
- package/dist/adapters/simplifyqa/executionFailures.d.ts.map +1 -1
- package/dist/adapters/simplifyqa/executionFailures.js +289 -46
- package/dist/adapters/simplifyqa/executionFailures.js.map +1 -1
- package/dist/adapters/simplifyqa/executionSources.d.ts +64 -0
- package/dist/adapters/simplifyqa/executionSources.d.ts.map +1 -0
- package/dist/adapters/simplifyqa/executionSources.js +138 -0
- package/dist/adapters/simplifyqa/executionSources.js.map +1 -0
- package/dist/adapters/simplifyqa/failureAnalysis.d.ts +18 -1
- package/dist/adapters/simplifyqa/failureAnalysis.d.ts.map +1 -1
- package/dist/adapters/simplifyqa/failureAnalysis.js +182 -10
- package/dist/adapters/simplifyqa/failureAnalysis.js.map +1 -1
- package/dist/adapters/simplifyqa/failureAnalysisCard.d.ts.map +1 -1
- package/dist/adapters/simplifyqa/failureAnalysisCard.js +45 -19
- package/dist/adapters/simplifyqa/failureAnalysisCard.js.map +1 -1
- package/dist/adapters/simplifyqa/failureAnalysisRun.d.ts +8 -1
- package/dist/adapters/simplifyqa/failureAnalysisRun.d.ts.map +1 -1
- package/dist/adapters/simplifyqa/failureAnalysisRun.js +108 -4
- package/dist/adapters/simplifyqa/failureAnalysisRun.js.map +1 -1
- package/dist/adapters/simplifyqa/failureAnalysisTypes.d.ts +65 -1
- package/dist/adapters/simplifyqa/failureAnalysisTypes.d.ts.map +1 -1
- package/dist/adapters/simplifyqa/failureAnalysisTypes.js +12 -1
- package/dist/adapters/simplifyqa/failureAnalysisTypes.js.map +1 -1
- package/dist/adapters/simplifyqa/failureHistory.d.ts +64 -20
- package/dist/adapters/simplifyqa/failureHistory.d.ts.map +1 -1
- package/dist/adapters/simplifyqa/failureHistory.js +88 -30
- package/dist/adapters/simplifyqa/failureHistory.js.map +1 -1
- package/dist/adapters/simplifyqa/failurePatterns.d.ts +11 -0
- package/dist/adapters/simplifyqa/failurePatterns.d.ts.map +1 -1
- package/dist/adapters/simplifyqa/failurePatterns.js +4 -3
- package/dist/adapters/simplifyqa/failurePatterns.js.map +1 -1
- package/dist/adapters/simplifyqa/failureReport.d.ts.map +1 -1
- package/dist/adapters/simplifyqa/failureReport.js +8 -0
- package/dist/adapters/simplifyqa/failureReport.js.map +1 -1
- package/dist/adapters/simplifyqa/failureReportModel.d.ts +125 -1
- package/dist/adapters/simplifyqa/failureReportModel.d.ts.map +1 -1
- package/dist/adapters/simplifyqa/failureReportModel.js +324 -4
- package/dist/adapters/simplifyqa/failureReportModel.js.map +1 -1
- package/dist/adapters/simplifyqa/failureReview.d.ts +1 -1
- package/dist/adapters/simplifyqa/failureReview.d.ts.map +1 -1
- package/dist/adapters/simplifyqa/failureReview.js +44 -8
- package/dist/adapters/simplifyqa/failureReview.js.map +1 -1
- package/dist/adapters/simplifyqa/failureSuggest.d.ts +4 -2
- package/dist/adapters/simplifyqa/failureSuggest.d.ts.map +1 -1
- package/dist/adapters/simplifyqa/failureSuggest.js +44 -14
- package/dist/adapters/simplifyqa/failureSuggest.js.map +1 -1
- package/dist/adapters/simplifyqa/failureTypes.d.ts +19 -0
- package/dist/adapters/simplifyqa/failureTypes.d.ts.map +1 -1
- package/dist/adapters/simplifyqa/heal/apply.d.ts +3 -1
- package/dist/adapters/simplifyqa/heal/apply.d.ts.map +1 -1
- package/dist/adapters/simplifyqa/heal/apply.js +5 -1
- package/dist/adapters/simplifyqa/heal/apply.js.map +1 -1
- package/dist/adapters/simplifyqa/heal/diagnose.d.ts.map +1 -1
- package/dist/adapters/simplifyqa/heal/diagnose.js +14 -0
- package/dist/adapters/simplifyqa/heal/diagnose.js.map +1 -1
- package/dist/adapters/simplifyqa/heal/plan.d.ts +2 -0
- package/dist/adapters/simplifyqa/heal/plan.d.ts.map +1 -1
- package/dist/adapters/simplifyqa/heal/plan.js +43 -0
- package/dist/adapters/simplifyqa/heal/plan.js.map +1 -1
- package/dist/adapters/simplifyqa/networkErrors.d.ts +11 -0
- package/dist/adapters/simplifyqa/networkErrors.d.ts.map +1 -0
- package/dist/adapters/simplifyqa/networkErrors.js +108 -0
- package/dist/adapters/simplifyqa/networkErrors.js.map +1 -0
- package/dist/adapters/simplifyqa/outage.d.ts +41 -0
- package/dist/adapters/simplifyqa/outage.d.ts.map +1 -0
- package/dist/adapters/simplifyqa/outage.js +108 -0
- package/dist/adapters/simplifyqa/outage.js.map +1 -0
- package/dist/adapters/simplifyqa/patternSplit.d.ts +32 -0
- package/dist/adapters/simplifyqa/patternSplit.d.ts.map +1 -0
- package/dist/adapters/simplifyqa/patternSplit.js +79 -0
- package/dist/adapters/simplifyqa/patternSplit.js.map +1 -0
- package/dist/adapters/simplifyqa/screenText.d.ts +84 -0
- package/dist/adapters/simplifyqa/screenText.d.ts.map +1 -0
- package/dist/adapters/simplifyqa/screenText.js +497 -0
- package/dist/adapters/simplifyqa/screenText.js.map +1 -0
- package/dist/domain/heal.d.ts +10 -0
- package/dist/domain/heal.d.ts.map +1 -1
- package/dist/domain/heal.js.map +1 -1
- package/dist/export/html.d.ts +26 -0
- package/dist/export/html.d.ts.map +1 -0
- package/dist/export/html.js +842 -0
- package/dist/export/html.js.map +1 -0
- package/dist/export/labelCompare.d.ts +36 -0
- package/dist/export/labelCompare.d.ts.map +1 -0
- package/dist/export/labelCompare.js +96 -0
- package/dist/export/labelCompare.js.map +1 -0
- package/dist/export/layout.d.ts +19 -10
- package/dist/export/layout.d.ts.map +1 -1
- package/dist/export/layout.js +40 -9
- package/dist/export/layout.js.map +1 -1
- package/dist/export/pdf.d.ts +31 -1
- package/dist/export/pdf.d.ts.map +1 -1
- package/dist/export/pdf.js +170 -34
- package/dist/export/pdf.js.map +1 -1
- package/dist/export/xlsx.d.ts +1 -1
- package/dist/export/xlsx.js +2 -2
- package/dist/export/xlsx.js.map +1 -1
- package/dist/initAgents.d.ts.map +1 -1
- package/dist/initAgents.js +10 -5
- package/dist/initAgents.js.map +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +10 -2
- package/dist/server.js.map +1 -1
- package/dist/tools/desktopRecordingMode.d.ts +27 -0
- package/dist/tools/desktopRecordingMode.d.ts.map +1 -0
- package/dist/tools/desktopRecordingMode.js +40 -0
- package/dist/tools/desktopRecordingMode.js.map +1 -0
- package/dist/tools/discovery.tools.d.ts.map +1 -1
- package/dist/tools/discovery.tools.js +89 -16
- package/dist/tools/discovery.tools.js.map +1 -1
- package/dist/tools/executionPlan.tools.d.ts.map +1 -1
- package/dist/tools/executionPlan.tools.js +9 -6
- package/dist/tools/executionPlan.tools.js.map +1 -1
- package/dist/tools/failure.tools.d.ts +10 -0
- package/dist/tools/failure.tools.d.ts.map +1 -1
- package/dist/tools/failure.tools.js +140 -18
- package/dist/tools/failure.tools.js.map +1 -1
- package/dist/tools/failureExport.tools.d.ts +1 -1
- package/dist/tools/failureExport.tools.d.ts.map +1 -1
- package/dist/tools/failureExport.tools.js +69 -26
- package/dist/tools/failureExport.tools.js.map +1 -1
- package/dist/tools/heal.tools.js +1 -1
- package/dist/tools/heal.tools.js.map +1 -1
- package/dist/tools/recording.tools.d.ts.map +1 -1
- package/dist/tools/recording.tools.js +12 -4
- package/dist/tools/recording.tools.js.map +1 -1
- package/dist/tools/recordingNames.d.ts +16 -0
- package/dist/tools/recordingNames.d.ts.map +1 -1
- package/dist/tools/recordingNames.js +31 -0
- package/dist/tools/recordingNames.js.map +1 -1
- package/dist/tools/storySync.tools.d.ts.map +1 -1
- package/dist/tools/storySync.tools.js +2 -1
- package/dist/tools/storySync.tools.js.map +1 -1
- package/dist/tools/testcase.tools.d.ts +13 -1
- package/dist/tools/testcase.tools.d.ts.map +1 -1
- package/dist/tools/testcase.tools.js +80 -13
- package/dist/tools/testcase.tools.js.map +1 -1
- package/dist/tools/verdictMemory.d.ts +55 -0
- package/dist/tools/verdictMemory.d.ts.map +1 -0
- package/dist/tools/verdictMemory.js +117 -0
- package/dist/tools/verdictMemory.js.map +1 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.d.ts.map +1 -1
- package/dist/version.js +1 -1
- package/dist/version.js.map +1 -1
- package/package.json +6 -2
|
@@ -1,6 +1,42 @@
|
|
|
1
1
|
import type { AnalysisFilter, Category, CategorySummary, FailureAnalysis } from './failureAnalysisTypes.js';
|
|
2
2
|
import { maskWith } from './failureReport.js';
|
|
3
|
+
import type { NetworkError } from './networkErrors.js';
|
|
4
|
+
import type { DomainProfile } from './appProfile.js';
|
|
5
|
+
import { type SourceKind } from './executionSources.js';
|
|
3
6
|
export { maskWith };
|
|
7
|
+
/** One failure reason of a source: a pattern of the root-cause table and the failed test cases it explains there. */
|
|
8
|
+
export type SourceReason = {
|
|
9
|
+
category: Category;
|
|
10
|
+
/** The pattern's number in the root-cause table (1..n); absent for a test case with no pattern. */
|
|
11
|
+
patternNo?: number;
|
|
12
|
+
/** As the root-cause table names it (split parts included). */
|
|
13
|
+
pattern: string;
|
|
14
|
+
count: number;
|
|
15
|
+
/** `TC-123 (v1.0)`. */
|
|
16
|
+
testcaseIds: string[];
|
|
17
|
+
};
|
|
18
|
+
/** A source of the execution(s) — how its test cases got into the run — with its outcome. */
|
|
19
|
+
export type SourceNode = {
|
|
20
|
+
/** 'direct' only for the Test Plan child "Test cases added directly to this Test Plan". */
|
|
21
|
+
kind: SourceKind | 'direct';
|
|
22
|
+
/** "Test Plan", "Suite", "User Story", "Module", "Test Case" (blank for 'direct'). */
|
|
23
|
+
label: string;
|
|
24
|
+
code?: string;
|
|
25
|
+
/** Masked. */
|
|
26
|
+
name: string;
|
|
27
|
+
/** What the files print: "<code> <name>" (or the name alone). */
|
|
28
|
+
title: string;
|
|
29
|
+
total: number;
|
|
30
|
+
passed: number;
|
|
31
|
+
failed: number;
|
|
32
|
+
notExecuted: number;
|
|
33
|
+
/** Failed test cases counted once, under their primary pattern's category. */
|
|
34
|
+
byCategory: Record<Category, number>;
|
|
35
|
+
/** Category order, then most failed first. */
|
|
36
|
+
reasons: SourceReason[];
|
|
37
|
+
/** Test Plan only: one per suite of the plan, then the test cases added directly; the plan's numbers are their sum. */
|
|
38
|
+
children?: SourceNode[];
|
|
39
|
+
};
|
|
4
40
|
export type AnalysisReport = {
|
|
5
41
|
title: string;
|
|
6
42
|
fileStem: string;
|
|
@@ -11,7 +47,38 @@ export type AnalysisReport = {
|
|
|
11
47
|
generatedAt: string;
|
|
12
48
|
};
|
|
13
49
|
summary: CategorySummary;
|
|
14
|
-
/**
|
|
50
|
+
/** Whole-execution totals (filled by a later step: needs the passed / not-executed counts). */
|
|
51
|
+
execution?: {
|
|
52
|
+
total: number;
|
|
53
|
+
passed: number;
|
|
54
|
+
failed: number;
|
|
55
|
+
notExecuted: number;
|
|
56
|
+
pct: {
|
|
57
|
+
passed: number;
|
|
58
|
+
failed: number;
|
|
59
|
+
notExecuted: number;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
/** Failed test cases whose main pattern is a timeout, in total and per category. */
|
|
63
|
+
timeouts?: {
|
|
64
|
+
total: number;
|
|
65
|
+
byCategory: Record<Category, number>;
|
|
66
|
+
};
|
|
67
|
+
/** For each of the 10 evidence inputs: how many of the failed test cases have it. */
|
|
68
|
+
inputsCoverage: Array<{
|
|
69
|
+
no: number;
|
|
70
|
+
available: number;
|
|
71
|
+
total: number;
|
|
72
|
+
note?: string;
|
|
73
|
+
}>;
|
|
74
|
+
/** The application domain as stated by the AI (or remembered). */
|
|
75
|
+
domain?: DomainProfile;
|
|
76
|
+
/** Analysis notes (masked), including outage notes. */
|
|
77
|
+
notes: string[];
|
|
78
|
+
/** Pattern group id -> outage note, for groups holding test cases of a suspected outage. */
|
|
79
|
+
outageGroups?: Record<number, string>;
|
|
80
|
+
/** Of the filtered view: failed test cases, their failed iterations (rows below), passed test cases.
|
|
81
|
+
* KNOWN LIMITATION: `passedTestcases` and the execution totals are those of the whole analysis, not narrowed by a filter. */
|
|
15
82
|
totals: {
|
|
16
83
|
failedTestcases: number;
|
|
17
84
|
failedIterations: number;
|
|
@@ -24,17 +91,33 @@ export type AnalysisReport = {
|
|
|
24
91
|
category: Category;
|
|
25
92
|
confidence: string;
|
|
26
93
|
rootCause: string;
|
|
94
|
+
/** The card's label when the group was split ("3b"). Internal: removed before the files are written
|
|
95
|
+
* (files number 1..n and name split parts "part k of n"). */
|
|
96
|
+
label?: string;
|
|
97
|
+
subtype?: string;
|
|
98
|
+
recommendedAction?: string;
|
|
27
99
|
/** Failed test cases of the view in this pattern (counted per test case). */
|
|
28
100
|
testcases: number;
|
|
29
101
|
/** Every one of them as `TC-1542 (v1.0)` — not capped. */
|
|
30
102
|
testcaseIds: string[];
|
|
31
103
|
screenshotUrl?: string;
|
|
104
|
+
/** Every affected suite / source code. */
|
|
105
|
+
suites: string[];
|
|
32
106
|
}>;
|
|
107
|
+
/** "Failures by source": every source with test cases (Test Plans, suites, user stories, modules,
|
|
108
|
+
* standalone — in that order, most failed first). Top-level failed / byCategory add up to the summary. */
|
|
109
|
+
sourcesTree: SourceNode[];
|
|
33
110
|
suites: Array<{
|
|
34
111
|
suite: string;
|
|
35
112
|
failed: number;
|
|
36
113
|
byCategory: Record<Category, number>;
|
|
37
114
|
topPatterns: string[];
|
|
115
|
+
/** failed + passed + not executed in the suite (a later step). */
|
|
116
|
+
total?: number;
|
|
117
|
+
passed?: number;
|
|
118
|
+
passRate?: number;
|
|
119
|
+
name?: string;
|
|
120
|
+
failedIds?: string[];
|
|
38
121
|
}>;
|
|
39
122
|
testcases: Array<{
|
|
40
123
|
suite: string;
|
|
@@ -64,8 +147,49 @@ export type AnalysisReport = {
|
|
|
64
147
|
* single fields above are the first of each). */
|
|
65
148
|
screenshotUrls?: string[];
|
|
66
149
|
lastPassedScreenshotUrls?: string[];
|
|
150
|
+
subtype?: string;
|
|
151
|
+
/** Where `reason` comes from; only 'pattern' exists today. */
|
|
152
|
+
reasonSource?: 'testcase' | 'pattern';
|
|
153
|
+
step?: {
|
|
154
|
+
no?: string;
|
|
155
|
+
description: string;
|
|
156
|
+
functionName?: string;
|
|
157
|
+
passedBefore?: number;
|
|
158
|
+
};
|
|
159
|
+
screen?: string;
|
|
160
|
+
status?: string;
|
|
161
|
+
error?: string;
|
|
162
|
+
logTail?: string[];
|
|
163
|
+
network?: NetworkError[];
|
|
164
|
+
waitMs?: number;
|
|
165
|
+
references?: string[];
|
|
166
|
+
testdata?: Array<{
|
|
167
|
+
name: string;
|
|
168
|
+
value: string;
|
|
169
|
+
}>;
|
|
170
|
+
history?: {
|
|
171
|
+
strip: Array<'P' | 'F' | 'N'>;
|
|
172
|
+
label: 'new failure' | 'recurring' | 'never passed' | 'first execution' | 'unknown';
|
|
173
|
+
recurringRuns?: number;
|
|
174
|
+
};
|
|
175
|
+
comparison?: {
|
|
176
|
+
dataChanged: string[];
|
|
177
|
+
stepsSkipped?: string[];
|
|
178
|
+
stepsAdded?: string[];
|
|
179
|
+
flow?: string;
|
|
180
|
+
matchedBy?: 'occurrence' | 'position';
|
|
181
|
+
source?: 'same suite' | 'other suite';
|
|
182
|
+
};
|
|
183
|
+
tcReportUrl?: string;
|
|
184
|
+
stepUrl?: string;
|
|
185
|
+
/** Pattern group id of this iteration, the test case's primary group id and its identity (execution + entry). */
|
|
186
|
+
patternId?: number;
|
|
187
|
+
primaryPatternId?: number;
|
|
188
|
+
tcKey?: string;
|
|
67
189
|
}>;
|
|
68
190
|
};
|
|
191
|
+
/** Percentages (1 decimal) of `counts` over their sum that add up to exactly 100.0 (largest remainder). */
|
|
192
|
+
export declare function largestRemainder(counts: number[]): number[];
|
|
69
193
|
/** Values of every protected test data entry in the analysis (each iteration's whole-run set and
|
|
70
194
|
* its failed steps' test data), longest first. */
|
|
71
195
|
export declare function protectedValues(a: FailureAnalysis): string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"failureReportModel.d.ts","sourceRoot":"","sources":["../../../src/adapters/simplifyqa/failureReportModel.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,cAAc,EAAoB,QAAQ,EAAE,eAAe,EAAE,eAAe,EAC7E,MAAM,2BAA2B,CAAC;AAKnC,OAAO,
|
|
1
|
+
{"version":3,"file":"failureReportModel.d.ts","sourceRoot":"","sources":["../../../src/adapters/simplifyqa/failureReportModel.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,cAAc,EAAoB,QAAQ,EAAE,eAAe,EAAE,eAAe,EAC7E,MAAM,2BAA2B,CAAC;AAKnC,OAAO,EAAwB,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AACpE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAGvD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAErD,OAAO,EACmG,KAAK,UAAU,EACxH,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,QAAQ,EAAE,CAAC;AAEpB,qHAAqH;AACrH,MAAM,MAAM,YAAY,GAAG;IACzB,QAAQ,EAAE,QAAQ,CAAC;IACnB,mGAAmG;IACnG,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,+DAA+D;IAC/D,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAA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OAAO,CAAC,EAAE,MAAM,CAAC;QACvC,iHAAiH;QACjH,SAAS,CAAC,EAAE,MAAM,CAAC;QAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC;KAC/D,CAAC,CAAC;CACJ,CAAC;AA0CF,2GAA2G;AAC3G,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAS3D;AAKD;mDACmD;AACnD,wBAAgB,eAAe,CAAC,CAAC,EAAE,eAAe,GAAG,MAAM,EAAE,CAiB5D;AAmFD,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,eAAe,EAAE,MAAM,EAAE,cAAc,EAAE,GAAG,EAAE,IAAI,GAAG,cAAc,CA4PtG"}
|
|
@@ -1,8 +1,68 @@
|
|
|
1
|
-
import { CATEGORY_ORDER, NO_SUITE, categoryOfTestcase, filterTestcases, summarise } from './failureAnalysis.js';
|
|
1
|
+
import { CATEGORY_ORDER, NO_SUITE, categoryOfTestcase, filterTestcases, suiteMatches, summarise } from './failureAnalysis.js';
|
|
2
2
|
import { FAILING_SINCE_UNAVAILABLE, FIRST_EXECUTION, HISTORY_UNAVAILABLE, NEVER_PASSED, editedText, failedRunsText, lastPassedText, whereText, } from './failureHistory.js';
|
|
3
|
-
import { MIN_MASKED_LEN, maskWith } from './failureReport.js';
|
|
3
|
+
import { MASK, MIN_MASKED_LEN, maskWith } from './failureReport.js';
|
|
4
|
+
import { screenLine } from './screenText.js';
|
|
5
|
+
import { outageNote } from './outage.js';
|
|
6
|
+
import { stepData } from './flow.js';
|
|
7
|
+
import { DIRECT_CHILD_NAME, SOURCE_KIND_ORDER, SOURCE_LABEL, STANDALONE_NAME, executionSource, } from './executionSources.js';
|
|
4
8
|
export { maskWith };
|
|
5
9
|
const TOP_PATTERNS = 3;
|
|
10
|
+
/**
|
|
11
|
+
* Report-only naming of split parts (patterns in their final order): each part's name gets
|
|
12
|
+
* "(part k of n, other part(s): #x)", and the card labels the AI wrote in its text ("Same as 1a",
|
|
13
|
+
* "pattern 3b") become the file's own numbers ("#4"). Returns group id -> display name; mutates the
|
|
14
|
+
* patterns' name / root cause / recommended action.
|
|
15
|
+
*/
|
|
16
|
+
function nameSplitParts(patterns, groupById) {
|
|
17
|
+
const posById = new Map(patterns.map((p, i) => [p.id, i + 1]));
|
|
18
|
+
const posByLabel = new Map();
|
|
19
|
+
for (const p of patterns) {
|
|
20
|
+
const l = groupById.get(p.id)?.label;
|
|
21
|
+
if (l && /^\d+[a-z]$/.test(l))
|
|
22
|
+
posByLabel.set(l, posById.get(p.id));
|
|
23
|
+
}
|
|
24
|
+
const relabel = (s) => s.replace(/\b(?:pattern\s+)?#?(\d+[a-z])\b/gi, (m, l) => {
|
|
25
|
+
const pos = posByLabel.get(l.toLowerCase());
|
|
26
|
+
return pos === undefined ? m : (/^pattern/i.test(m) ? `pattern #${pos}` : `#${pos}`);
|
|
27
|
+
});
|
|
28
|
+
const family = new Map();
|
|
29
|
+
for (const p of patterns) {
|
|
30
|
+
const root = groupById.get(p.id)?.parentId ?? p.id;
|
|
31
|
+
family.set(root, [...(family.get(root) ?? []), p.id]);
|
|
32
|
+
}
|
|
33
|
+
const names = new Map();
|
|
34
|
+
for (const p of patterns) {
|
|
35
|
+
p.rootCause = relabel(p.rootCause);
|
|
36
|
+
if (p.recommendedAction)
|
|
37
|
+
p.recommendedAction = relabel(p.recommendedAction);
|
|
38
|
+
const fam = family.get(groupById.get(p.id)?.parentId ?? p.id);
|
|
39
|
+
if (fam.length > 1) {
|
|
40
|
+
const others = fam.filter((id) => id !== p.id).map((id) => `#${posById.get(id)}`).join(', ');
|
|
41
|
+
p.pattern = `${p.pattern} (part ${fam.indexOf(p.id) + 1} of ${fam.length}, other part${fam.length > 2 ? 's' : ''}: ${others})`;
|
|
42
|
+
}
|
|
43
|
+
delete p.label;
|
|
44
|
+
names.set(p.id, p.pattern);
|
|
45
|
+
}
|
|
46
|
+
return { names, relabel };
|
|
47
|
+
}
|
|
48
|
+
const round1 = (n) => Math.round(n * 10) / 10;
|
|
49
|
+
/** Percentages (1 decimal) of `counts` over their sum that add up to exactly 100.0 (largest remainder). */
|
|
50
|
+
export function largestRemainder(counts) {
|
|
51
|
+
const total = counts.reduce((a, c) => a + c, 0);
|
|
52
|
+
if (total <= 0)
|
|
53
|
+
return counts.map(() => 0);
|
|
54
|
+
const units = counts.map((c) => (c / total) * 1000);
|
|
55
|
+
const floors = units.map(Math.floor);
|
|
56
|
+
let left = 1000 - floors.reduce((a, c) => a + c, 0);
|
|
57
|
+
const order = units.map((u, i) => ({ i, r: u - Math.floor(u) })).sort((x, y) => y.r - x.r || x.i - y.i);
|
|
58
|
+
for (const { i } of order) {
|
|
59
|
+
if (left <= 0)
|
|
60
|
+
break;
|
|
61
|
+
floors[i] += 1;
|
|
62
|
+
left--;
|
|
63
|
+
}
|
|
64
|
+
return floors.map((f) => f / 10);
|
|
65
|
+
}
|
|
6
66
|
const suiteLabel = (s) => s.code ?? s.name ?? (s.id !== undefined ? `SU-${s.id}` : NO_SUITE);
|
|
7
67
|
/** Values of every protected test data entry in the analysis (each iteration's whole-run set and
|
|
8
68
|
* its failed steps' test data), longest first. */
|
|
@@ -38,6 +98,79 @@ const failedStepOf = (it) => {
|
|
|
38
98
|
return it.exception ?? '';
|
|
39
99
|
return f.trail || (f.reportStep ? `step ${f.reportStep}` : f.description);
|
|
40
100
|
};
|
|
101
|
+
const parseData = (text) => {
|
|
102
|
+
const out = new Map();
|
|
103
|
+
for (const part of (text ?? '').split('; ')) {
|
|
104
|
+
const i = part.indexOf('=');
|
|
105
|
+
if (i > 0)
|
|
106
|
+
out.set(part.slice(0, i).trim(), part.slice(i + 1));
|
|
107
|
+
}
|
|
108
|
+
return out;
|
|
109
|
+
};
|
|
110
|
+
function extraRow(tc, it, f, cmp, mask) {
|
|
111
|
+
const out = {};
|
|
112
|
+
if (f) {
|
|
113
|
+
const no = f.reportStep ?? f.testcaseStep;
|
|
114
|
+
out.step = {
|
|
115
|
+
...(no ? { no } : {}),
|
|
116
|
+
description: mask(f.description) ?? '',
|
|
117
|
+
...(f.functionName ? { functionName: mask(f.functionName) ?? f.functionName } : {}),
|
|
118
|
+
};
|
|
119
|
+
const err = f.cause ?? f.exception ?? it.exception;
|
|
120
|
+
if (err)
|
|
121
|
+
out.error = mask(err) ?? err;
|
|
122
|
+
const tail = (f.logTail ?? f.logs ?? []).slice(-5).map((l) => mask(l.replace(/\s+$/, '')) ?? l);
|
|
123
|
+
if (tail.length)
|
|
124
|
+
out.logTail = tail;
|
|
125
|
+
if (f.networkErrors?.length)
|
|
126
|
+
out.network = f.networkErrors.slice(0, 3);
|
|
127
|
+
if (f.waitMs !== undefined && f.waitMs > 0)
|
|
128
|
+
out.waitMs = f.waitMs;
|
|
129
|
+
if (it.stepCounts?.passed > 0 && out.step)
|
|
130
|
+
out.step.passedBefore = it.stepCounts.passed;
|
|
131
|
+
const td = (f.testdata ?? []).slice(0, 12).map((t) => ({
|
|
132
|
+
name: String(t['paramName'] ?? t['runtimeKey'] ?? 'param'),
|
|
133
|
+
value: t['protected'] === true ? MASK : (mask(String(t['value'] ?? '')) ?? ''),
|
|
134
|
+
}));
|
|
135
|
+
if (td.length)
|
|
136
|
+
out.testdata = td;
|
|
137
|
+
}
|
|
138
|
+
else if (it.exception) {
|
|
139
|
+
out.error = mask(it.exception) ?? it.exception;
|
|
140
|
+
}
|
|
141
|
+
if (it.screen) {
|
|
142
|
+
const line = screenLine(it.screen);
|
|
143
|
+
if (line)
|
|
144
|
+
out.screen = mask(line) ?? line;
|
|
145
|
+
const status = it.screen.shownInstead ?? it.screen.errorOnScreen?.[0];
|
|
146
|
+
if (status)
|
|
147
|
+
out.status = mask(status) ?? status;
|
|
148
|
+
}
|
|
149
|
+
if (it.references?.length)
|
|
150
|
+
out.references = it.references.slice(0, 5).map((x) => mask(x) ?? x);
|
|
151
|
+
const h = tc.history;
|
|
152
|
+
if (h) {
|
|
153
|
+
// Newest first (the analysis keeps the recent runs oldest to newest).
|
|
154
|
+
const strip = [...(h.recent ?? [])].reverse();
|
|
155
|
+
// failingSince.failedRuns counts the failed runs BEFORE today's execution, so today's run is +1.
|
|
156
|
+
const before = h.failingSince?.failedRuns ?? 0;
|
|
157
|
+
out.history = h.status === 'passed-before'
|
|
158
|
+
? (before >= 1
|
|
159
|
+
? { strip, label: 'recurring', recurringRuns: before + 1 }
|
|
160
|
+
: { strip, label: 'new failure' })
|
|
161
|
+
: { strip, label: h.status === 'never-passed' ? 'never passed' : h.status === 'first-execution' ? 'first execution' : 'unknown' };
|
|
162
|
+
}
|
|
163
|
+
if (cmp && cmp.found) {
|
|
164
|
+
const now = parseData(stepData({ testdata: f?.testdata }));
|
|
165
|
+
const was = parseData(mask(cmp.data));
|
|
166
|
+
const dataChanged = [...now].filter(([k, v]) => was.has(k) && was.get(k) !== v).map(([k]) => mask(k) ?? k);
|
|
167
|
+
out.comparison = {
|
|
168
|
+
dataChanged,
|
|
169
|
+
...(cmp.matchedBy ? { matchedBy: cmp.matchedBy === 'occurrence' ? 'occurrence' : 'position' } : {}),
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
return out;
|
|
173
|
+
}
|
|
41
174
|
export function buildReportModel(a, filter, now) {
|
|
42
175
|
const mask = maskWith(protectedValues(a));
|
|
43
176
|
const tcs = filterTestcases(a, filter);
|
|
@@ -118,6 +251,13 @@ export function buildReportModel(a, filter, now) {
|
|
|
118
251
|
...(baseline ? { baselineUrl: baseline } : {}),
|
|
119
252
|
...(shots.length ? { screenshotUrls: shots } : {}),
|
|
120
253
|
...(passShots.length ? { lastPassedScreenshotUrls: passShots } : {}),
|
|
254
|
+
...(verdict?.subtype ? { subtype: mask(verdict.subtype) ?? verdict.subtype } : {}),
|
|
255
|
+
reasonSource: 'pattern',
|
|
256
|
+
...(g ? { patternId: g.id } : {}),
|
|
257
|
+
primaryPatternId: tc.primaryGroup,
|
|
258
|
+
tcKey: tc.key,
|
|
259
|
+
...extraRow(tc, it, it.focus, cmp, mask),
|
|
260
|
+
...(reportUrl ? { tcReportUrl: reportUrl } : {}),
|
|
121
261
|
});
|
|
122
262
|
}
|
|
123
263
|
}
|
|
@@ -134,32 +274,50 @@ export function buildReportModel(a, filter, now) {
|
|
|
134
274
|
const shot = rep?.it.focus?.screenshots[0]?.absoluteUrl;
|
|
135
275
|
patterns.push({
|
|
136
276
|
id: g.id,
|
|
277
|
+
...(g.label !== undefined ? { label: g.label } : {}),
|
|
137
278
|
pattern: patternName(g),
|
|
138
279
|
category: categoryOfGroup(g),
|
|
139
280
|
confidence: v?.confidence ?? 'unverified',
|
|
140
281
|
rootCause: v ? (mask(v.rootCause) ?? '') : `(suggested: ${g.suggested.category ?? '—'})`,
|
|
282
|
+
...(v?.subtype ? { subtype: mask(v.subtype) ?? v.subtype } : {}),
|
|
283
|
+
recommendedAction: v?.recommendedAction ? (mask(v.recommendedAction) ?? '') : '',
|
|
141
284
|
testcases: inGroup.length,
|
|
142
285
|
testcaseIds: [...new Set(inGroup.map((tc) => testcaseLabel(tc, mask)))],
|
|
286
|
+
suites: [...new Set(g.suites.map(suiteLabel))],
|
|
143
287
|
...(shot ? { screenshotUrl: shot } : {}),
|
|
144
288
|
});
|
|
145
289
|
}
|
|
146
290
|
patterns.sort((x, y) => y.testcases - x.testcases || x.id - y.id);
|
|
291
|
+
// Split parts: plain numbers and "part k of n" names in the files; rows and sources follow.
|
|
292
|
+
const { names: displayName, relabel } = nameSplitParts(patterns, groupById);
|
|
293
|
+
for (const r of rows) {
|
|
294
|
+
if (r.patternId !== undefined && displayName.has(r.patternId))
|
|
295
|
+
r.pattern = displayName.get(r.patternId);
|
|
296
|
+
r.reason = relabel(r.reason);
|
|
297
|
+
}
|
|
147
298
|
// suites (grouped by source: a section per suite / plan / source)
|
|
148
299
|
const bySuite = new Map();
|
|
149
300
|
for (const tc of tcs) {
|
|
150
301
|
const k = tc.sourceCode ?? suiteLabel(tc.suite);
|
|
151
302
|
bySuite.set(k, [...(bySuite.get(k) ?? []), tc]);
|
|
152
303
|
}
|
|
304
|
+
const totalsOf = new Map((a.suiteTotals ?? []).map((t) => [suiteLabel(t.suite), t]));
|
|
153
305
|
const suites = [...bySuite].map(([suite, list]) => {
|
|
154
306
|
const byCategory = Object.fromEntries(CATEGORY_ORDER.map((c) => [c, 0]));
|
|
155
307
|
const perPattern = new Map();
|
|
156
308
|
for (const tc of list) {
|
|
157
309
|
byCategory[categoryOfTestcase(a, tc)] += 1;
|
|
158
|
-
const name = patternName(groupById.get(tc.primaryGroup));
|
|
310
|
+
const name = displayName.get(tc.primaryGroup) ?? patternName(groupById.get(tc.primaryGroup));
|
|
159
311
|
perPattern.set(name, (perPattern.get(name) ?? 0) + 1);
|
|
160
312
|
}
|
|
161
313
|
const topPatterns = [...perPattern].sort((x, y) => y[1] - x[1]).slice(0, TOP_PATTERNS).map(([n]) => n);
|
|
162
|
-
|
|
314
|
+
const name = list[0]?.suite.name;
|
|
315
|
+
const failedIds = [...new Set(list.map((t) => t.code).filter((c) => !!c))].sort();
|
|
316
|
+
const st = totalsOf.get(suiteLabel(list[0].suite)) ?? totalsOf.get(suite);
|
|
317
|
+
return {
|
|
318
|
+
suite, failed: list.length, byCategory, topPatterns, ...(name ? { name: mask(name) ?? name } : {}), failedIds,
|
|
319
|
+
...(st ? { total: st.total, passed: st.passed, passRate: st.total ? round1((st.passed / st.total) * 100) : 0 } : {}),
|
|
320
|
+
};
|
|
163
321
|
});
|
|
164
322
|
const filterParts = [];
|
|
165
323
|
if (filter.suiteId !== undefined)
|
|
@@ -180,6 +338,60 @@ export function buildReportModel(a, filter, now) {
|
|
|
180
338
|
safe(a.id) || undefined,
|
|
181
339
|
date,
|
|
182
340
|
].filter((p) => !!p).join('_');
|
|
341
|
+
// timeouts: failed test cases whose main pattern is a timeout, by category
|
|
342
|
+
const timeoutByCategory = Object.fromEntries(CATEGORY_ORDER.map((c) => [c, 0]));
|
|
343
|
+
let timeoutTotal = 0;
|
|
344
|
+
for (const tc of tcs) {
|
|
345
|
+
if (groupById.get(tc.primaryGroup)?.family !== 'timeout')
|
|
346
|
+
continue;
|
|
347
|
+
timeoutTotal++;
|
|
348
|
+
timeoutByCategory[categoryOfTestcase(a, tc)] += 1;
|
|
349
|
+
}
|
|
350
|
+
// inputs coverage: how many failed test cases carry each evidence input
|
|
351
|
+
const mainOf = (tc) => tc.failedIterations[0];
|
|
352
|
+
const has = [
|
|
353
|
+
(tc) => !!tc.name,
|
|
354
|
+
(tc) => !!(tc.description || mainOf(tc)?.it.testcaseDescription),
|
|
355
|
+
(tc) => tc.failedIterations.some((f) => !!f.it.focus),
|
|
356
|
+
(tc) => tc.failedIterations.some((f) => !!(f.it.focus?.logTail?.length || f.it.focus?.logs?.length)),
|
|
357
|
+
(tc) => tc.failedIterations.some((f) => !!f.it.screen?.text),
|
|
358
|
+
(tc) => tc.failedIterations.some((f) => f.it.focus?.expected !== undefined || f.it.focus?.actual !== undefined),
|
|
359
|
+
(tc) => tc.failedIterations.some((f) => !!f.it.focus?.testdata?.length),
|
|
360
|
+
(tc) => tc.failedIterations.some((f) => !!a.comparisons[f.key]?.found),
|
|
361
|
+
(tc) => !!tc.history && tc.history.status !== 'unknown',
|
|
362
|
+
(tc) => tc.failedIterations.some((f) => !!(f.it.focus?.apiData || f.it.focus?.networkErrors?.length)),
|
|
363
|
+
];
|
|
364
|
+
const inputsCoverage = has.map((fn, i) => ({ no: i + 1, available: tcs.filter(fn).length, total: tcs.length }));
|
|
365
|
+
const noteOf = (no, text) => {
|
|
366
|
+
const c = inputsCoverage.find((x) => x.no === no);
|
|
367
|
+
if (c)
|
|
368
|
+
c.note = text;
|
|
369
|
+
};
|
|
370
|
+
noteOf(5, `text read: ${inputsCoverage[4].available}/${tcs.length}`);
|
|
371
|
+
noteOf(8, `matched by position: ${tcs.filter((tc) => tc.failedIterations.some((f) => {
|
|
372
|
+
const c = a.comparisons[f.key];
|
|
373
|
+
return !!c?.found && !!c.matchedBy && c.matchedBy !== 'occurrence';
|
|
374
|
+
})).length}`);
|
|
375
|
+
noteOf(10, `HTTP errors found: ${tcs.filter((tc) => tc.failedIterations.some((f) => !!f.it.focus?.networkErrors?.length)).length}`);
|
|
376
|
+
// whole-execution totals; the failed count is the filtered view's, so the three parts always add up
|
|
377
|
+
const filteredSuite = filter.suiteId === undefined ? undefined
|
|
378
|
+
: (a.suiteTotals ?? []).find((t) => suiteMatches(t.suite, filter.suiteId));
|
|
379
|
+
const exPassed = filteredSuite ? filteredSuite.passed : (a.counts?.passed ?? a.passedTestcases);
|
|
380
|
+
const exNot = filteredSuite ? filteredSuite.notExecuted : (a.counts?.notExecuted ?? 0);
|
|
381
|
+
const exTotal = exPassed + tcs.length + exNot;
|
|
382
|
+
const [pPassed, pFailed, pNot] = largestRemainder([exPassed, tcs.length, exNot]);
|
|
383
|
+
const execution = {
|
|
384
|
+
total: exTotal, passed: exPassed, failed: tcs.length, notExecuted: exNot,
|
|
385
|
+
pct: { passed: pPassed, failed: pFailed, notExecuted: pNot },
|
|
386
|
+
};
|
|
387
|
+
const outageGroups = {};
|
|
388
|
+
for (const c of a.outages ?? []) {
|
|
389
|
+
const keys = new Set(c.keys);
|
|
390
|
+
for (const g of a.groups) {
|
|
391
|
+
if (g.iterationKeys.some((k) => keys.has(k)))
|
|
392
|
+
outageGroups[g.id] = mask(outageNote(c)) ?? outageNote(c);
|
|
393
|
+
}
|
|
394
|
+
}
|
|
183
395
|
return {
|
|
184
396
|
title: 'Failure Analysis Report',
|
|
185
397
|
fileStem: stem,
|
|
@@ -192,8 +404,116 @@ export function buildReportModel(a, filter, now) {
|
|
|
192
404
|
summary: summarise(a, filter),
|
|
193
405
|
totals: { failedTestcases: tcs.length, failedIterations: rows.length, passedTestcases: a.passedTestcases },
|
|
194
406
|
patterns,
|
|
407
|
+
sourcesTree: buildSourcesTree(a, filter, tcs, patterns, displayName, patternName, groupById, mask),
|
|
195
408
|
suites,
|
|
196
409
|
testcases: rows,
|
|
410
|
+
execution,
|
|
411
|
+
timeouts: { total: timeoutTotal, byCategory: timeoutByCategory },
|
|
412
|
+
inputsCoverage,
|
|
413
|
+
notes: a.notes.map((n) => mask(n) ?? n),
|
|
414
|
+
...(a.domain ? {
|
|
415
|
+
domain: {
|
|
416
|
+
...a.domain,
|
|
417
|
+
name: mask(a.domain.name) ?? a.domain.name,
|
|
418
|
+
flows: a.domain.flows.map((f) => mask(f) ?? f),
|
|
419
|
+
terms: Object.fromEntries(Object.entries(a.domain.terms ?? {}).map(([k, v]) => [mask(k) ?? k, mask(String(v)) ?? String(v)])),
|
|
420
|
+
},
|
|
421
|
+
} : {}),
|
|
422
|
+
...(Object.keys(outageGroups).length ? { outageGroups } : {}),
|
|
423
|
+
};
|
|
424
|
+
}
|
|
425
|
+
const emptyByCategory = () => Object.fromEntries(CATEGORY_ORDER.map((c) => [c, 0]));
|
|
426
|
+
const titleOf = (code, name) => (code && name && !name.startsWith(code) ? `${code} ${name}` : name || code || '');
|
|
427
|
+
/**
|
|
428
|
+
* The "Failures by source" tree. Failed counts are the filtered failed test cases (exactly those of the
|
|
429
|
+
* summary); passed / not executed come from every other entry of the executions (narrowed by the suite
|
|
430
|
+
* filter only — like the execution totals, a pattern / category filter does not narrow them).
|
|
431
|
+
*/
|
|
432
|
+
function buildSourcesTree(a, filter, tcs, patterns, displayName, patternName, groupById, mask) {
|
|
433
|
+
const top = new Map();
|
|
434
|
+
const posOf = new Map(patterns.map((p, i) => [p.id, i + 1]));
|
|
435
|
+
const named = (o, fallback) => mask(o.name) ?? fallback;
|
|
436
|
+
const fresh = (kind, code, name) => ({
|
|
437
|
+
node: {
|
|
438
|
+
kind, label: kind === 'direct' ? '' : SOURCE_LABEL[kind], ...(code ? { code } : {}), name, title: titleOf(code, name),
|
|
439
|
+
total: 0, passed: 0, failed: 0, notExecuted: 0, byCategory: emptyByCategory(), reasons: [],
|
|
440
|
+
},
|
|
441
|
+
reasons: new Map(),
|
|
442
|
+
});
|
|
443
|
+
/** The accumulators an entry of `o` counts in: its top-level source, and the Test Plan child if any. */
|
|
444
|
+
const accsOf = (o) => {
|
|
445
|
+
const key = o.kind === 'testcase' ? 'testcase' : `${o.kind}:${o.id ?? ''}`;
|
|
446
|
+
let acc = top.get(key);
|
|
447
|
+
if (!acc) {
|
|
448
|
+
const name = o.kind === 'testcase' ? STANDALONE_NAME : named(o, `${SOURCE_LABEL[o.kind]} ${o.id ?? ''}`.trim());
|
|
449
|
+
acc = fresh(o.kind, o.code, name);
|
|
450
|
+
top.set(key, acc);
|
|
451
|
+
}
|
|
452
|
+
if (o.kind !== 'testplan')
|
|
453
|
+
return [acc];
|
|
454
|
+
const c = o.child ?? { kind: 'direct' };
|
|
455
|
+
const ckey = c.kind === 'suite' ? `suite:${c.id ?? ''}` : 'direct';
|
|
456
|
+
acc.children ?? (acc.children = new Map());
|
|
457
|
+
let child = acc.children.get(ckey);
|
|
458
|
+
if (!child) {
|
|
459
|
+
child = c.kind === 'suite'
|
|
460
|
+
? fresh('suite', c.code, named(c, `Suite ${c.id ?? ''}`.trim()))
|
|
461
|
+
: fresh('direct', undefined, DIRECT_CHILD_NAME);
|
|
462
|
+
acc.children.set(ckey, child);
|
|
463
|
+
}
|
|
464
|
+
return [acc, child];
|
|
465
|
+
};
|
|
466
|
+
const fallbackOrigin = (tc) => {
|
|
467
|
+
const ex = a.executions.find((e) => String(e.id) === tc.executionId);
|
|
468
|
+
return ex && String(ex.type ?? '').toUpperCase() !== 'EXECUTIONPLAN' ? executionSource(ex) : { kind: 'testcase' };
|
|
469
|
+
};
|
|
470
|
+
for (const tc of tcs) {
|
|
471
|
+
const category = categoryOfTestcase(a, tc);
|
|
472
|
+
// The reason is its primary pattern; under a pattern filter, the first of its patterns the table shows.
|
|
473
|
+
const gid = posOf.has(tc.primaryGroup) ? tc.primaryGroup : (tc.groups.find((g) => posOf.has(g)) ?? tc.primaryGroup);
|
|
474
|
+
const pattern = displayName.get(gid) ?? patternName(groupById.get(gid));
|
|
475
|
+
const patternNo = posOf.get(gid);
|
|
476
|
+
const label = testcaseLabel(tc, mask);
|
|
477
|
+
for (const acc of accsOf(tc.origin ?? fallbackOrigin(tc))) {
|
|
478
|
+
const n = acc.node;
|
|
479
|
+
n.total++;
|
|
480
|
+
n.failed++;
|
|
481
|
+
n.byCategory[category] += 1;
|
|
482
|
+
const rk = `${category}|${patternNo ?? 0}|${pattern}`;
|
|
483
|
+
let reason = acc.reasons.get(rk);
|
|
484
|
+
if (!reason) {
|
|
485
|
+
reason = { category, ...(patternNo !== undefined ? { patternNo } : {}), pattern, count: 0, testcaseIds: [] };
|
|
486
|
+
acc.reasons.set(rk, reason);
|
|
487
|
+
}
|
|
488
|
+
reason.count++;
|
|
489
|
+
if (!reason.testcaseIds.includes(label))
|
|
490
|
+
reason.testcaseIds.push(label);
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
for (const en of a.sourceEntries ?? []) {
|
|
494
|
+
if (en.status === 'failed')
|
|
495
|
+
continue;
|
|
496
|
+
if (filter.suiteId !== undefined && !suiteMatches(en.suite, filter.suiteId))
|
|
497
|
+
continue;
|
|
498
|
+
for (const acc of accsOf(en.origin)) {
|
|
499
|
+
acc.node.total++;
|
|
500
|
+
if (en.status === 'passed')
|
|
501
|
+
acc.node.passed++;
|
|
502
|
+
else
|
|
503
|
+
acc.node.notExecuted++;
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
const catPos = (c) => CATEGORY_ORDER.indexOf(c);
|
|
507
|
+
const finish = (acc) => {
|
|
508
|
+
const n = acc.node;
|
|
509
|
+
n.reasons = [...acc.reasons.values()].sort((x, y) => catPos(x.category) - catPos(y.category) || y.count - x.count || (x.patternNo ?? 1e9) - (y.patternNo ?? 1e9));
|
|
510
|
+
if (acc.children) {
|
|
511
|
+
n.children = [...acc.children.values()].map(finish).filter((c) => c.total > 0)
|
|
512
|
+
.sort((x, y) => Number(x.kind === 'direct') - Number(y.kind === 'direct') || y.failed - x.failed || x.title.localeCompare(y.title));
|
|
513
|
+
}
|
|
514
|
+
return n;
|
|
197
515
|
};
|
|
516
|
+
return [...top.values()].map(finish).filter((n) => n.total > 0).sort((x, y) => SOURCE_KIND_ORDER.indexOf(x.kind) - SOURCE_KIND_ORDER.indexOf(y.kind)
|
|
517
|
+
|| y.failed - x.failed || x.title.localeCompare(y.title));
|
|
198
518
|
}
|
|
199
519
|
//# sourceMappingURL=failureReportModel.js.map
|