devops: fix parameterised tests on flakiness dashboard (#24486)
Fixes https://github.com/microsoft/devops.playwright.dev/issues/2
This commit is contained in:
parent
1277ec9900
commit
c6a0e5d02c
|
|
@ -64,7 +64,7 @@ function compressReports(reports) {
|
||||||
let specObject = specs.get(specId);
|
let specObject = specs.get(specId);
|
||||||
if (!specObject) {
|
if (!specObject) {
|
||||||
specObject = {
|
specObject = {
|
||||||
title: spec.title,
|
title: spec.titlePath.join(' › '),
|
||||||
line: spec.line,
|
line: spec.line,
|
||||||
column: spec.column,
|
column: spec.column,
|
||||||
tests: new Map(),
|
tests: new Map(),
|
||||||
|
|
|
||||||
|
|
@ -22,13 +22,17 @@ const gunzipAsync = util.promisify(zlib.gunzip);
|
||||||
|
|
||||||
const blobServiceClient = BlobServiceClient.fromConnectionString(process.env.AzureWebJobsStorage);
|
const blobServiceClient = BlobServiceClient.fromConnectionString(process.env.AzureWebJobsStorage);
|
||||||
|
|
||||||
function flattenSpecs(suite, result = []) {
|
function flattenSpecs(suite, result = [], titlePaths = []) {
|
||||||
if (suite.suites) {
|
if (suite.suites) {
|
||||||
for (const child of suite.suites)
|
for (const child of suite.suites) {
|
||||||
flattenSpecs(child, result);
|
const isFileSuite = child.column === 0 && child.line === 0;
|
||||||
|
flattenSpecs(child, result, (!isFileSuite && child.title) ? [...titlePaths, child.title]: titlePaths);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
for (const spec of suite.specs || [])
|
for (const spec of suite.specs || []) {
|
||||||
|
spec.titlePath = [...titlePaths, spec.title];
|
||||||
result.push(spec);
|
result.push(spec);
|
||||||
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue