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
|
@@ -9,10 +9,12 @@ import { notDeleted, pickArray, str } from './mapper.js';
|
|
|
9
9
|
import { mapLimit } from './mapLimit.js';
|
|
10
10
|
import { causeSignature, currentRuns, EXECUTION_TYPE_BY_KIND, failureState, groupBy, iterationLabel, lastTouchedStep, numberSteps, parseEntityCode, realFailures, reportStepLabel, runKey, runLabel, } from './stepRules.js';
|
|
11
11
|
import { apiBrief, buildFlow, functionCallsLine, notRunLines, stepData } from './flow.js';
|
|
12
|
-
import { createHistoryCache, executionInfo,
|
|
12
|
+
import { createHistoryCache, executionInfo, REVIEW_LOG_LINES, failingSinceFrom, lastPassedOf, MAX_PASSED_PAGES, PASSED_PAGE_SIZE, PASSED_SEARCH_LIMIT, passedRunFor, pickComparisonRowAt, occurrenceOf, iterationFilter, isEarlierRun, passedRunOf, earlierRunRows, } from './failureHistory.js';
|
|
13
13
|
import { maskDeep, maskWith, protectedOf } from './failureReport.js';
|
|
14
14
|
import { normaliseImageUrl } from './failureImages.js';
|
|
15
|
+
import { networkErrors } from './networkErrors.js';
|
|
15
16
|
import { categoryOf, cleanLogLines, extractCause, isNoiseLine, trimTrace } from './failureCategory.js';
|
|
17
|
+
import { executionSource, resolvePlanSources } from './executionSources.js';
|
|
16
18
|
/** Log lines kept per failed step by default — the tail nearest the failure (ai-assistant FAILURE_LOG_TAIL). */
|
|
17
19
|
export const FAILURE_LOG_TAIL = 30;
|
|
18
20
|
/** Longest test case description kept (after markup is stripped). */
|
|
@@ -254,6 +256,68 @@ export function locatorOf(logs, row) {
|
|
|
254
256
|
parts.push(`object locators: ${obj}`);
|
|
255
257
|
return parts.length ? parts.join(' · ') : undefined;
|
|
256
258
|
}
|
|
259
|
+
const MAX_REFERENCES = 5;
|
|
260
|
+
/** Runtime parameter names that say "reference": ref / reference / txn / transaction / tbc / ft /
|
|
261
|
+
* trn / utr / rrn / id as a word or camelCase part (orderId, txnRef, FT_REF). Not "no" / "number":
|
|
262
|
+
* those also name phone / card numbers. */
|
|
263
|
+
const REF_NAME_RE = /(?:^|[^a-z])(?:ref|reference|txn|transaction|tbc|ft|trn|utr|rrn|id)(?:$|[^a-z])/;
|
|
264
|
+
/** Names that may hold a credential — never exported, whatever the value looks like. */
|
|
265
|
+
const SECRET_NAME_RE = /token|secret|key|pass|pwd|auth|session|cookie|otp|pin|bearer|jwt|cred|signature|hash|salt/;
|
|
266
|
+
/** A banking-style reference: 2-5 capitals, then >= 8 capitals / digits with at least one digit (FT2431012345). */
|
|
267
|
+
const BANK_REF_RE = /^[A-Z]{2,5}(?=[A-Z0-9]*\d)[A-Z0-9]{8,}$/;
|
|
268
|
+
/** camelCase / snake / kebab name → lower-case words separated by spaces. */
|
|
269
|
+
const nameWords = (name) => name.replace(/([a-z\d])([A-Z])/g, '$1 $2').replace(/[_\-.]+/g, ' ').toLowerCase();
|
|
270
|
+
/** A value that could be a token / key rather than a reference: long, or mixed case with digits. */
|
|
271
|
+
const tokenLike = (v) => v.length > 24 || (v.length >= 12 && /[a-z]/.test(v) && /[A-Z]/.test(v) && /\d/.test(v));
|
|
272
|
+
/**
|
|
273
|
+
* Values the run stored at run time (runtime key) that are record references: the value of a
|
|
274
|
+
* runtime parameter whose NAME says reference (REF_NAME_RE), or a value with a banking reference
|
|
275
|
+
* shape (BANK_REF_RE). Never a parameter named like a credential, a protected value, a token-like
|
|
276
|
+
* value (> 24 chars, or mixed case with digits), and only values the mask leaves unchanged.
|
|
277
|
+
*/
|
|
278
|
+
export function referencesOf(steps, mask) {
|
|
279
|
+
const out = [];
|
|
280
|
+
for (const st of steps) {
|
|
281
|
+
if (st.state === 'not_executed' || st.state === 'info')
|
|
282
|
+
continue;
|
|
283
|
+
for (const d of (st.testdata ?? [])) {
|
|
284
|
+
if (!d || d.protected === true || !d.runtimeKey || typeof d.value !== 'string')
|
|
285
|
+
continue;
|
|
286
|
+
const v = d.value.trim();
|
|
287
|
+
const name = nameWords(String(d.runtimeKey ?? d.paramName ?? ''));
|
|
288
|
+
if (SECRET_NAME_RE.test(name.replace(/\s+/g, '')))
|
|
289
|
+
continue;
|
|
290
|
+
if (!/^[A-Za-z0-9][A-Za-z0-9\-/]{5,23}$/.test(v) || tokenLike(v) || !/\d/.test(v))
|
|
291
|
+
continue;
|
|
292
|
+
if (!REF_NAME_RE.test(name) && !BANK_REF_RE.test(v))
|
|
293
|
+
continue;
|
|
294
|
+
const masked = mask(v);
|
|
295
|
+
if (masked !== v || out.includes(masked))
|
|
296
|
+
continue;
|
|
297
|
+
out.push(masked);
|
|
298
|
+
if (out.length >= MAX_REFERENCES)
|
|
299
|
+
return out;
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
return out;
|
|
303
|
+
}
|
|
304
|
+
const WAIT_MS_RE = /\b(?:time-?out|timed out|retry(?:ing)?|waited|waiting|wait)\b[^\d\n]{0,24}(\d+(?:\.\d+)?)\s*(ms|milliseconds?|s|secs?|seconds?)?\b/gi;
|
|
305
|
+
/** Longest wait / time-out the log lines state, in ms (`timeout 45000`, `Max timeout: 90000 ms`, `waited 30 s`); undefined when none. */
|
|
306
|
+
export function waitMsOf(lines) {
|
|
307
|
+
let best;
|
|
308
|
+
for (const l of lines) {
|
|
309
|
+
for (const m of l.matchAll(WAIT_MS_RE)) {
|
|
310
|
+
const n = Number(m[1]);
|
|
311
|
+
if (!Number.isFinite(n) || n <= 0)
|
|
312
|
+
continue;
|
|
313
|
+
const unit = (m[2] ?? 'ms').toLowerCase();
|
|
314
|
+
const ms = unit.startsWith('ms') || unit.startsWith('milli') ? n : n * 1000;
|
|
315
|
+
if (best === undefined || ms > best)
|
|
316
|
+
best = ms;
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
return best;
|
|
320
|
+
}
|
|
257
321
|
/** One raw step-result row → the failure-analysis step (cleaned, tailed logs; cause; category). */
|
|
258
322
|
export function normalizeFailureStep(s, base, opts) {
|
|
259
323
|
const status = String(s?.status ?? '').toUpperCase();
|
|
@@ -271,6 +335,7 @@ export function normalizeFailureStep(s, base, opts) {
|
|
|
271
335
|
: [];
|
|
272
336
|
const evidenceLines = errorLines.length ? errorLines : (state === 'failed' ? cleaned.slice(-3) : []);
|
|
273
337
|
const td = Array.isArray(s?.testdata) ? s.testdata : [];
|
|
338
|
+
const waitMs = failedStep ? waitMsOf(allLogs) : undefined;
|
|
274
339
|
const expected = str(s, 'expectedResult') ?? expectedFromTestdata(td) ?? expectedFromLogs(allLogs);
|
|
275
340
|
const actual = str(s, 'actualResult') ?? actualFromLogs(allLogs);
|
|
276
341
|
const screenshots = opts.includeScreenshots && Array.isArray(s?.screenShots)
|
|
@@ -316,6 +381,7 @@ export function normalizeFailureStep(s, base, opts) {
|
|
|
316
381
|
const recordedThumbnail = image(THUMBNAIL_FIELDS, 'element thumbnail');
|
|
317
382
|
// The failed step's last lines, kept for the review even where `logs` is later cleared.
|
|
318
383
|
const logTail = opts.includeLogs && failedStep ? cleaned.slice(-REVIEW_LOG_LINES) : [];
|
|
384
|
+
const netErrors = s?.networkLogs ? networkErrors(s.networkLogs, opts.mask) : [];
|
|
319
385
|
return {
|
|
320
386
|
seq: typeof s?.seq === 'number' ? s.seq : 0,
|
|
321
387
|
...(typeof s?.reportSeq === 'number' || typeof s?.reportSeq === 'string' ? { reportSeq: s.reportSeq } : {}),
|
|
@@ -341,6 +407,8 @@ export function normalizeFailureStep(s, base, opts) {
|
|
|
341
407
|
...(imageNotes.length ? { imageNotes } : {}),
|
|
342
408
|
...(td.length ? { testdata: td } : {}),
|
|
343
409
|
...(s?.networkLogs && (Array.isArray(s.networkLogs) ? s.networkLogs.length > 0 : Object.keys(s.networkLogs).length > 0) ? { networkLogs: s.networkLogs } : {}),
|
|
410
|
+
...(netErrors.length ? { networkErrors: netErrors } : {}),
|
|
411
|
+
...(waitMs !== undefined ? { waitMs } : {}),
|
|
344
412
|
...(s?.apiData ? { apiData: s.apiData } : {}),
|
|
345
413
|
...(s?.defectIds ? { defectIds: s.defectIds } : {}),
|
|
346
414
|
...(typeof s?.selfHealed === 'boolean' ? { selfHealed: s.selfHealed } : {}),
|
|
@@ -352,8 +420,25 @@ export function normalizeFailureStep(s, base, opts) {
|
|
|
352
420
|
...(failedStep ? { category: categoryOf(cause?.text, cause?.source) } : {}),
|
|
353
421
|
};
|
|
354
422
|
}
|
|
423
|
+
const RECENT_RUNS = 10;
|
|
424
|
+
/** P / F / N letters of the earlier runs, oldest to newest. */
|
|
425
|
+
function recentOf(rows, bound) {
|
|
426
|
+
return earlierRunRows(rows, bound).slice(0, RECENT_RUNS).reverse().map((r) => {
|
|
427
|
+
const s = String(r?.status ?? '').toUpperCase();
|
|
428
|
+
return s === 'PASSED' ? 'P' : s === 'FAILED' ? 'F' : 'N';
|
|
429
|
+
});
|
|
430
|
+
}
|
|
355
431
|
/** A test case entry of an execution: test case, its version and its suite entry (`stepId`). */
|
|
356
432
|
const entryKey = (r) => JSON.stringify([r?.executionItemId ?? null, r?.versionId ?? null, r?.stepId ?? null]);
|
|
433
|
+
/** Wait before retrying a step-result read that hit a gateway error. */
|
|
434
|
+
export const STEP_READ_RETRY_MS = 1500;
|
|
435
|
+
/** A gateway / unavailable error worth one retry: HTTP 502, 503 or 504. */
|
|
436
|
+
function isGatewayError(e) {
|
|
437
|
+
const status = e?.status;
|
|
438
|
+
if (status === 502 || status === 503 || status === 504)
|
|
439
|
+
return true;
|
|
440
|
+
return /\bHTTP 50[234]\b/.test(e instanceof Error ? e.message : String(e));
|
|
441
|
+
}
|
|
357
442
|
/**
|
|
358
443
|
* A failure screenshot as base64, for returning inline. Only artifacts on the connected SQA host
|
|
359
444
|
* are fetched (with the SQA bearer token); anything else, anything over `maxBytes`, or anything
|
|
@@ -484,11 +569,17 @@ export class ExecutionFailureAnalysis {
|
|
|
484
569
|
const planItems = Array.isArray(execDoc.executionItems) ? execDoc.executionItems : [];
|
|
485
570
|
const itByRunKey = new Map(analysed.map((a) => [runKey(a.run), a.it]));
|
|
486
571
|
const entries = new Map();
|
|
572
|
+
const itemOfEntry = new Map();
|
|
573
|
+
// The same test case can be in a plan twice (from two sources): match the item by version and
|
|
574
|
+
// plan line (stepId) first, then by the test case alone.
|
|
575
|
+
const same = (a, b) => String(a ?? '') === String(b ?? '');
|
|
576
|
+
const itemOf = (r) => planItems.find((p) => p?.id !== undefined && same(p.id, r?.executionItemId) && same(p.versionId, r?.versionId) && same(p.stepId, r?.stepId))
|
|
577
|
+
?? planItems.find((p) => p?.id !== undefined && String(p.id) === String(r?.executionItemId));
|
|
487
578
|
for (const r of runs) {
|
|
488
579
|
const key = entryKey(r);
|
|
489
580
|
let e = entries.get(key);
|
|
490
581
|
if (!e) {
|
|
491
|
-
const item =
|
|
582
|
+
const item = itemOf(r);
|
|
492
583
|
e = {
|
|
493
584
|
executionItemId: String(r?.executionItemId ?? ''),
|
|
494
585
|
...(str(r, 'code') ? { code: str(r, 'code') } : {}),
|
|
@@ -500,6 +591,7 @@ export class ExecutionFailureAnalysis {
|
|
|
500
591
|
failedIterations: [],
|
|
501
592
|
};
|
|
502
593
|
entries.set(key, e);
|
|
594
|
+
itemOfEntry.set(e, item);
|
|
503
595
|
}
|
|
504
596
|
const st = String(r?.status ?? '').toUpperCase();
|
|
505
597
|
e.iterations.total++;
|
|
@@ -515,6 +607,7 @@ export class ExecutionFailureAnalysis {
|
|
|
515
607
|
}
|
|
516
608
|
const allEntries = [...entries.values()];
|
|
517
609
|
await this.nameEntries(allEntries);
|
|
610
|
+
await this.sourceEntries(execDoc, allEntries, itemOfEntry);
|
|
518
611
|
for (const e of allEntries) {
|
|
519
612
|
for (const it of e.failedIterations) {
|
|
520
613
|
if (e.name)
|
|
@@ -602,6 +695,13 @@ export class ExecutionFailureAnalysis {
|
|
|
602
695
|
...(passedEntries.length ? { passed: passedEntries.map((e) => e.code ?? e.executionItemId) } : {}),
|
|
603
696
|
groups,
|
|
604
697
|
testcases,
|
|
698
|
+
entries: allEntries.map((e) => ({
|
|
699
|
+
executionItemId: e.executionItemId,
|
|
700
|
+
...(e.source ? { source: e.source } : {}),
|
|
701
|
+
...(e.origin ? { origin: e.origin } : {}),
|
|
702
|
+
status: e.iterations.failed > 0 ? 'failed'
|
|
703
|
+
: e.iterations.total > 0 && e.iterations.passed === e.iterations.total ? 'passed' : 'other',
|
|
704
|
+
})),
|
|
605
705
|
notes,
|
|
606
706
|
};
|
|
607
707
|
}
|
|
@@ -615,34 +715,37 @@ export class ExecutionFailureAnalysis {
|
|
|
615
715
|
if (!lp)
|
|
616
716
|
return null;
|
|
617
717
|
// No failed step (run-level, or no step id): nothing to compare. null, never found:false — that
|
|
618
|
-
// would read as "the step is not in the passed version" (a
|
|
718
|
+
// would read as "the step is not in the passed version" (a hint that the test may be outdated).
|
|
619
719
|
const stepId = it.focus?.stepId;
|
|
620
720
|
if (!stepId || it.source === 'run_level')
|
|
621
721
|
return null;
|
|
622
722
|
// The passed run of the SAME iteration when there is one (ITR-2 with ITR-2's data), else the first.
|
|
623
723
|
// It may have passed in another execution than the last pass (any suite / plan / standalone).
|
|
624
|
-
const { runId, executionId } = passedRunFor(lp, it.iteration);
|
|
724
|
+
const { runId, executionId, iteration, sameIteration } = passedRunFor(lp, it.iteration);
|
|
625
725
|
const base = {
|
|
626
726
|
executionId,
|
|
627
727
|
...(lp.executionCode && executionId === lp.executionId ? { executionCode: lp.executionCode } : {}),
|
|
628
728
|
runId,
|
|
629
729
|
found: false,
|
|
730
|
+
...(iteration ? { iteration } : {}),
|
|
731
|
+
...(sameIteration !== undefined ? { sameIteration } : {}),
|
|
630
732
|
};
|
|
631
733
|
// One read per passed run for the whole analysis: iterations / test cases that last passed in
|
|
632
734
|
// the same run share it. A failed read is not kept, so the next comparison retries.
|
|
633
735
|
const cacheKey = `${executionId}:${runId}`;
|
|
634
736
|
let pending = rowsCache?.get(cacheKey);
|
|
635
737
|
if (!pending) {
|
|
636
|
-
pending = this.
|
|
738
|
+
pending = this.passedRunRows(Number(executionId), runId, Number(executionItemId));
|
|
637
739
|
if (rowsCache) {
|
|
638
740
|
rowsCache.set(cacheKey, pending);
|
|
639
741
|
pending.catch(() => rowsCache.delete(cacheKey));
|
|
640
742
|
}
|
|
641
743
|
}
|
|
642
744
|
const rows = await pending;
|
|
643
|
-
const
|
|
644
|
-
if (!
|
|
745
|
+
const picked = pickComparisonRowAt(rows, stepId, it.focus?.occurrence ?? -1);
|
|
746
|
+
if (!picked)
|
|
645
747
|
return base;
|
|
748
|
+
const raw = picked.row;
|
|
646
749
|
// Masked with every protected value of the passed run AND of the failing iteration.
|
|
647
750
|
const row = maskRow(raw, maskOf([...protectedOf(rows), ...(it.protectedValues ?? [])]));
|
|
648
751
|
const step = normalizeFailureStep(row, this.deps.baseUrl, { includeLogs: true, maxLogLines: REVIEW_LOG_LINES, includeScreenshots: true });
|
|
@@ -659,6 +762,7 @@ export class ExecutionFailureAnalysis {
|
|
|
659
762
|
return {
|
|
660
763
|
...base,
|
|
661
764
|
found: true,
|
|
765
|
+
matchedBy: picked.matchedBy,
|
|
662
766
|
status: step.status,
|
|
663
767
|
...(value ? { value } : {}),
|
|
664
768
|
...(step.expected !== undefined ? { expected: step.expected } : {}),
|
|
@@ -676,14 +780,17 @@ export class ExecutionFailureAnalysis {
|
|
|
676
780
|
}
|
|
677
781
|
/**
|
|
678
782
|
* History of each failed test case of `ctx`, searched across EVERY execution of the test case
|
|
679
|
-
* (standalone, any suite, any plan) that ran before `ctx.execution
|
|
680
|
-
*
|
|
681
|
-
*
|
|
682
|
-
*
|
|
683
|
-
*
|
|
684
|
-
*
|
|
783
|
+
* (standalone, any suite, any plan) that ran before `ctx.execution`, with small searches on
|
|
784
|
+
* `/exec/report/search`:
|
|
785
|
+
* - the LAST PASS: the newest PASSED run, one row; when that row is not earlier history it pages
|
|
786
|
+
* on until a real earlier pass is found (or there is none) — the last pass is never given up;
|
|
787
|
+
* - FAILING SINCE: the oldest FAILED run after that pass (every earlier failure when it never
|
|
788
|
+
* passed), one row, counted by the search's totalCount — which also tells "never passed" from
|
|
789
|
+
* "first execution".
|
|
790
|
+
* `cache` is shared by one analysis. A failed pass search makes that test case `unknown` — never
|
|
791
|
+
* first-execution / never-passed.
|
|
685
792
|
*/
|
|
686
|
-
async failureHistory(ctx, cache = createHistoryCache(
|
|
793
|
+
async failureHistory(ctx, cache = createHistoryCache()) {
|
|
687
794
|
const current = Number(ctx.execution.id);
|
|
688
795
|
// Today's own runs (and their copies in a parent execution) are never history.
|
|
689
796
|
const exclude = new Set(ctx.testcases.flatMap((t) => t.failedIterations.map((it) => it.runId)));
|
|
@@ -701,13 +808,33 @@ export class ExecutionFailureAnalysis {
|
|
|
701
808
|
}
|
|
702
809
|
let lastPassed;
|
|
703
810
|
try {
|
|
704
|
-
const
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
811
|
+
const found = await this.lastPassOf(cache, item, bound);
|
|
812
|
+
lastPassed = found.lastPassed;
|
|
813
|
+
if (found.exhausted) {
|
|
814
|
+
// A pass may exist beyond the page cap: never-passed / first-execution would be a guess.
|
|
815
|
+
out.set(key, { status: 'unknown', passSearchExhausted: true });
|
|
816
|
+
return;
|
|
817
|
+
}
|
|
818
|
+
if (lastPassed && found.row) {
|
|
819
|
+
// Data-driven: each failing iteration is compared with the last pass of the SAME iteration
|
|
820
|
+
// (its own data row) — one more one-row search per failing iteration whose label differs
|
|
821
|
+
// from the newest pass's. Best-effort: without it the comparison uses the newest pass, labelled.
|
|
822
|
+
const newest = passedRunOf(found.row);
|
|
823
|
+
const runs = [newest];
|
|
824
|
+
const labels = [...new Set(tc.failedIterations.map((it) => it.iteration).filter((l) => !!l))];
|
|
825
|
+
for (const label of labels) {
|
|
826
|
+
// Runs that carry no iteration (not data-driven): nothing to match.
|
|
827
|
+
if (!newest.iteration || label === newest.iteration)
|
|
828
|
+
continue;
|
|
829
|
+
try {
|
|
830
|
+
const same = await this.lastPassOf(cache, item, bound, label);
|
|
831
|
+
if (same.row)
|
|
832
|
+
runs.push(passedRunOf(same.row));
|
|
833
|
+
}
|
|
834
|
+
catch { /* falls back to the newest pass */ }
|
|
835
|
+
}
|
|
836
|
+
if (labels.length)
|
|
837
|
+
lastPassed.runs = runs;
|
|
711
838
|
}
|
|
712
839
|
}
|
|
713
840
|
catch {
|
|
@@ -717,10 +844,20 @@ export class ExecutionFailureAnalysis {
|
|
|
717
844
|
let failingSince;
|
|
718
845
|
let failingSinceUnavailable = false;
|
|
719
846
|
try {
|
|
720
|
-
//
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
847
|
+
// The failed runs after the last pass (by execution id) that are earlier history: the oldest
|
|
848
|
+
// (asc) and the newest (dsc), one row each; rows that are not earlier history (concurrent
|
|
849
|
+
// sibling runs, today's runs) are skipped and taken off the search's count.
|
|
850
|
+
const after = lastPassed ? Number(lastPassed.executionId) : undefined;
|
|
851
|
+
const q = { before: current, ...(after !== undefined && Number.isFinite(after) ? { after } : {}) };
|
|
852
|
+
const oldest = await this.firstEarlier(cache, item, 'FAILED', { ...q, sort: 'asc' }, bound);
|
|
853
|
+
if (oldest.row) {
|
|
854
|
+
const single = oldest.skipped === 0 && oldest.total === 1;
|
|
855
|
+
const newest = single ? { skipped: 0 } : await this.firstEarlier(cache, item, 'FAILED', { ...q, sort: 'dsc' }, bound);
|
|
856
|
+
failingSince = failingSinceFrom(oldest.row, 'exhausted' in newest && newest.exhausted ? undefined : oldest.total, oldest.skipped + newest.skipped);
|
|
857
|
+
}
|
|
858
|
+
else if (oldest.exhausted) {
|
|
859
|
+
throw new Error('failed-run search reached its page limit');
|
|
860
|
+
}
|
|
724
861
|
}
|
|
725
862
|
catch {
|
|
726
863
|
// Without a pass, "never passed" and "first execution" cannot be told apart.
|
|
@@ -742,6 +879,14 @@ export class ExecutionFailureAnalysis {
|
|
|
742
879
|
from: lastPassed.versionId, to: String(tc.versionId), ...(tc.versionName ? { toName: tc.versionName } : {}),
|
|
743
880
|
};
|
|
744
881
|
}
|
|
882
|
+
// The last 10 runs of any status before this execution (the strip); never fails the history.
|
|
883
|
+
try {
|
|
884
|
+
const any = await this.runsOf(cache, item, undefined, { before: current, sort: 'dsc', limit: RECENT_RUNS, page: 0 });
|
|
885
|
+
const recent = recentOf(any.rows, bound);
|
|
886
|
+
if (recent.length)
|
|
887
|
+
h.recent = recent;
|
|
888
|
+
}
|
|
889
|
+
catch { /* the strip is optional */ }
|
|
745
890
|
out.set(key, h);
|
|
746
891
|
});
|
|
747
892
|
// Where it passed / started failing: each execution read once per analysis, best-effort.
|
|
@@ -754,33 +899,77 @@ export class ExecutionFailureAnalysis {
|
|
|
754
899
|
Object.assign(w, executionInfo(docs.get(w.executionId)));
|
|
755
900
|
return out;
|
|
756
901
|
}
|
|
757
|
-
/**
|
|
758
|
-
|
|
759
|
-
|
|
902
|
+
/**
|
|
903
|
+
* The last pass before `bound.before`: the newest PASSED run (one row). When that row is not
|
|
904
|
+
* earlier history (today's run, a run that ended after this execution started), the passed runs
|
|
905
|
+
* are paged until a real earlier pass is found or none are left — capped at MAX_PASSED_PAGES
|
|
906
|
+
* (hitting the cap without a pass reports `exhausted`: the history is then `unknown`).
|
|
907
|
+
*/
|
|
908
|
+
async lastPassOf(cache, item, bound, iteration) {
|
|
909
|
+
const found = await this.firstEarlier(cache, item, 'PASSED', {
|
|
910
|
+
before: bound.before, sort: 'dsc', ...(iteration ? { itr: iterationFilter(iteration) } : {}),
|
|
911
|
+
}, bound, iteration ? (r) => iterationLabel(r) === iteration : undefined);
|
|
912
|
+
const lastPassed = found.row ? lastPassedOf([found.row], bound) : undefined;
|
|
913
|
+
return { lastPassed, ...(found.row ? { row: found.row } : {}), ...(found.exhausted ? { exhausted: true } : {}) };
|
|
914
|
+
}
|
|
915
|
+
/**
|
|
916
|
+
* The first run of a search (in its sort order) that is earlier history (and `also`): one row
|
|
917
|
+
* first; when that row is not (a run that ended once this execution had started, one of today's
|
|
918
|
+
* runs), pages of PASSED_PAGE_SIZE until one is — capped at MAX_PASSED_PAGES (`exhausted`).
|
|
919
|
+
* `skipped`: rows before it that were not earlier history; `total`: the search's totalCount.
|
|
920
|
+
*/
|
|
921
|
+
async firstEarlier(cache, item, status, q, bound, also) {
|
|
922
|
+
const ok = (r) => String(r?.status ?? '').toUpperCase() === status && isEarlierRun(r, bound) && (!also || also(r));
|
|
923
|
+
const first = await this.runsOf(cache, item, status, { ...q, limit: PASSED_SEARCH_LIMIT, page: 0 });
|
|
924
|
+
const total = first.total;
|
|
925
|
+
const withTotal = total !== undefined ? { total } : {};
|
|
926
|
+
const r0 = first.rows[0];
|
|
927
|
+
if (!r0)
|
|
928
|
+
return { skipped: 0, ...withTotal };
|
|
929
|
+
if (ok(r0))
|
|
930
|
+
return { row: r0, skipped: 0, ...withTotal };
|
|
931
|
+
let skipped = 0;
|
|
932
|
+
for (let page = 0; page < MAX_PASSED_PAGES; page++) {
|
|
933
|
+
const r = await this.runsOf(cache, item, status, { ...q, limit: PASSED_PAGE_SIZE, page });
|
|
934
|
+
for (const row of r.rows) {
|
|
935
|
+
if (ok(row))
|
|
936
|
+
return { row, skipped, ...withTotal };
|
|
937
|
+
skipped++;
|
|
938
|
+
}
|
|
939
|
+
if (r.rows.length < PASSED_PAGE_SIZE)
|
|
940
|
+
return { skipped, ...withTotal };
|
|
941
|
+
}
|
|
942
|
+
return { skipped, ...withTotal, exhausted: true };
|
|
943
|
+
}
|
|
944
|
+
/** One run search per (test case, status, bounds, sort, page) per analysis. */
|
|
945
|
+
runsOf(cache, item, status, q) {
|
|
946
|
+
const key = JSON.stringify([item, status, q.before, q.after ?? null, q.sort, q.limit, q.page, q.itr ?? null]);
|
|
760
947
|
let p = cache.runs.get(key);
|
|
761
948
|
if (!p) {
|
|
762
|
-
p = this.searchRuns(item, status,
|
|
949
|
+
p = this.searchRuns(item, status, q);
|
|
763
950
|
cache.runs.set(key, p);
|
|
764
951
|
}
|
|
765
952
|
return p;
|
|
766
953
|
}
|
|
767
|
-
/** `/exec/report/search` (executionRuns): runs of one test case
|
|
768
|
-
*
|
|
769
|
-
*
|
|
770
|
-
*
|
|
771
|
-
async searchRuns(item, status,
|
|
772
|
-
const passed = status === 'PASSED';
|
|
954
|
+
/** `/exec/report/search` (executionRuns): runs of one test case with `after < executionId <
|
|
955
|
+
* before` (integer operators — each search field is its own AND clause), parent-execution copies
|
|
956
|
+
* and deleted rows excluded by the server, sorted by endTime, `startIndex` = page index. No date
|
|
957
|
+
* comparison is sent: the server's search treats a string value as an exact match. */
|
|
958
|
+
async searchRuns(item, status, q) {
|
|
773
959
|
const raw = await this.deps.http.postJson('/exec/report/search', {
|
|
774
960
|
searchFields: [
|
|
775
|
-
{ column: 'endTime', sort:
|
|
961
|
+
{ column: 'endTime', sort: q.sort },
|
|
776
962
|
{ column: 'deleted', value: false },
|
|
777
963
|
{ column: 'projectId', value: this.deps.projectId, regEx: false },
|
|
778
964
|
{ column: 'executionItemId', value: item, regEx: false },
|
|
779
|
-
{ column: 'status', value: status, regEx: false },
|
|
780
|
-
{ column: '
|
|
965
|
+
...(status ? [{ column: 'status', value: status, regEx: false }] : []),
|
|
966
|
+
{ column: 'parentExecutionCopy', value: true, operator: 'nor' },
|
|
967
|
+
{ column: 'executionId', value: q.before, operator: 'lt' },
|
|
968
|
+
...(q.after !== undefined ? [{ column: 'executionId', value: q.after, operator: 'gt' }] : []),
|
|
969
|
+
...(q.itr ? [{ column: q.itr.column, value: q.itr.value, regEx: false }] : []),
|
|
781
970
|
],
|
|
782
|
-
startIndex:
|
|
783
|
-
limit:
|
|
971
|
+
startIndex: q.page,
|
|
972
|
+
limit: q.limit,
|
|
784
973
|
});
|
|
785
974
|
const total = Number(raw?.totalCount ?? raw?.total);
|
|
786
975
|
return { rows: pickArray(raw, 'data', 'content'), ...(Number.isFinite(total) ? { total } : {}) };
|
|
@@ -911,12 +1100,31 @@ export class ExecutionFailureAnalysis {
|
|
|
911
1100
|
e.versionName = v;
|
|
912
1101
|
}
|
|
913
1102
|
}
|
|
1103
|
+
/** Each entry's source (Test Plan / suite / user story / module / standalone), names resolved as
|
|
1104
|
+
* the Reports screen resolves them. Never throws: an unknown name reads "<Label> <id>". */
|
|
1105
|
+
async sourceEntries(execDoc, entries, itemOf) {
|
|
1106
|
+
if (String(execDoc?.type ?? '').toUpperCase() !== 'EXECUTIONPLAN') {
|
|
1107
|
+
const one = executionSource({
|
|
1108
|
+
type: String(execDoc?.type ?? ''),
|
|
1109
|
+
...(execDoc?.executionTypeId !== undefined && execDoc?.executionTypeId !== null ? { executionTypeId: String(execDoc.executionTypeId) } : {}),
|
|
1110
|
+
...(str(execDoc, 'executionTypeCode') ? { executionTypeCode: str(execDoc, 'executionTypeCode') } : {}),
|
|
1111
|
+
...(str(execDoc, 'executionTypeName') ? { executionTypeName: str(execDoc, 'executionTypeName') } : {}),
|
|
1112
|
+
});
|
|
1113
|
+
for (const e of entries)
|
|
1114
|
+
e.origin = one;
|
|
1115
|
+
return;
|
|
1116
|
+
}
|
|
1117
|
+
const search = (path, ids, select) => this.searchByIds(path, ids.map((i) => (/^\d+$/.test(String(i)) ? Number(i) : i)), select, true);
|
|
1118
|
+
const origins = await resolvePlanSources(search, entries.map((e) => ({ testcaseId: e.executionItemId, item: itemOf.get(e) })));
|
|
1119
|
+
entries.forEach((e, i) => { const o = origins[i]; if (o)
|
|
1120
|
+
e.origin = o; });
|
|
1121
|
+
}
|
|
914
1122
|
/** Rows of a TM search by id, one request; [] for no ids. */
|
|
915
|
-
async searchByIds(path, ids, select) {
|
|
1123
|
+
async searchByIds(path, ids, select, useIn = false) {
|
|
916
1124
|
if (!ids.length)
|
|
917
1125
|
return [];
|
|
918
1126
|
const raw = await this.deps.http.postJson(path, {
|
|
919
|
-
searchFields: [{ column: 'deleted', value: false }, { column: 'projectId', value: this.deps.projectId }, { column: 'id', value: ids }],
|
|
1127
|
+
searchFields: [{ column: 'deleted', value: false }, { column: 'projectId', value: this.deps.projectId }, { column: 'id', value: useIn ? { $in: ids } : ids }],
|
|
920
1128
|
startIndex: 0, limit: ids.length, skipStartIndex: 1, selectFields: select,
|
|
921
1129
|
});
|
|
922
1130
|
return pickArray(raw, 'data', 'content');
|
|
@@ -947,8 +1155,11 @@ export class ExecutionFailureAnalysis {
|
|
|
947
1155
|
if (secrets.length)
|
|
948
1156
|
it.protectedValues = secrets;
|
|
949
1157
|
const m = maskOf(secrets);
|
|
950
|
-
const steps = keepStepRows(all).map((s) => normalizeFailureStep(maskRow(s, m), base, opts));
|
|
1158
|
+
const steps = keepStepRows(all).map((s) => normalizeFailureStep(maskRow(s, m), base, { ...opts, mask: m }));
|
|
951
1159
|
numberSteps(steps, String(run.type ?? '').toUpperCase() !== 'MANUAL');
|
|
1160
|
+
const refs = referencesOf(steps, m);
|
|
1161
|
+
if (refs.length)
|
|
1162
|
+
it.references = refs;
|
|
952
1163
|
for (const s of steps) {
|
|
953
1164
|
// A FUNCTION heading carries its child's verdict — counting it says one result twice.
|
|
954
1165
|
if (s.state === 'info' || s.state === 'unknown' || String(s.stepType ?? '').toUpperCase() === 'FUNCTION')
|
|
@@ -968,6 +1179,12 @@ export class ExecutionFailureAnalysis {
|
|
|
968
1179
|
it.failedSteps = failures;
|
|
969
1180
|
it.focus = failures[0];
|
|
970
1181
|
it.source = 'step';
|
|
1182
|
+
const fs = it.focus;
|
|
1183
|
+
if (fs.rowId && fs.stepId) {
|
|
1184
|
+
const occ = occurrenceOf(all, fs.rowId, fs.stepId);
|
|
1185
|
+
if (occ >= 0)
|
|
1186
|
+
fs.occurrence = occ;
|
|
1187
|
+
}
|
|
971
1188
|
}
|
|
972
1189
|
else {
|
|
973
1190
|
const last = lastTouchedStep(steps);
|
|
@@ -1009,11 +1226,37 @@ export class ExecutionFailureAnalysis {
|
|
|
1009
1226
|
/** Every step-result row of one run, in report order — control-flow and marker rows included
|
|
1010
1227
|
* (the FLOW needs them; failure detection uses `keepStepRows`). */
|
|
1011
1228
|
async fetchStepRows(executionId, executionRunId, parentId) {
|
|
1012
|
-
const
|
|
1013
|
-
|
|
1014
|
-
|
|
1229
|
+
const body = { ...(executionId !== undefined ? { executionId } : {}), executionRunId, parentId, projectId: this.deps.projectId };
|
|
1230
|
+
const read = () => this.deps.http.postJson('/reports/execution/getstepResult', body);
|
|
1231
|
+
let resp;
|
|
1232
|
+
try {
|
|
1233
|
+
resp = await read();
|
|
1234
|
+
}
|
|
1235
|
+
catch (e) {
|
|
1236
|
+
// A gateway hiccup (502/503/504) is retried once before the run counts as unreadable.
|
|
1237
|
+
if (!isGatewayError(e))
|
|
1238
|
+
throw e;
|
|
1239
|
+
const ms = this.deps.retryDelayMs ?? STEP_READ_RETRY_MS;
|
|
1240
|
+
if (ms > 0)
|
|
1241
|
+
await new Promise((r) => setTimeout(r, ms));
|
|
1242
|
+
resp = await read();
|
|
1243
|
+
}
|
|
1015
1244
|
return Array.isArray(resp?.data) ? notDeleted(resp.data) : [];
|
|
1016
1245
|
}
|
|
1246
|
+
/**
|
|
1247
|
+
* The step rows of a passed run for a comparison. When none are stored under the run's own
|
|
1248
|
+
* execution id (the rows were kept under another execution — a re-run or a parent copy), the run's
|
|
1249
|
+
* rows are read by run id alone; rows of several executions are narrowed to one (the lowest id).
|
|
1250
|
+
*/
|
|
1251
|
+
async passedRunRows(executionId, runId, parentId) {
|
|
1252
|
+
const rows = await this.fetchStepRows(executionId, runId, parentId);
|
|
1253
|
+
if (rows.length)
|
|
1254
|
+
return rows;
|
|
1255
|
+
const any = (await this.fetchStepRows(undefined, runId, parentId))
|
|
1256
|
+
.filter((r) => r?.executionRunId === undefined || String(r.executionRunId) === runId);
|
|
1257
|
+
const ids = [...new Set(any.map((r) => Number(r?.executionId)).filter((n) => Number.isFinite(n)))].sort((a, b) => a - b);
|
|
1258
|
+
return ids.length > 1 ? any.filter((r) => Number(r?.executionId) === ids[0]) : any;
|
|
1259
|
+
}
|
|
1017
1260
|
/** The test case's written steps for one version (what it was going to do), or [] when unreadable. */
|
|
1018
1261
|
async fetchWrittenSteps(testcaseId, versionId) {
|
|
1019
1262
|
const params = new URLSearchParams({ projectId: String(this.deps.projectId), tcfnId: testcaseId, type: 'TC' });
|