Skip to content

Commit 3499cbf

Browse files
authored
chore: save test stats (#9138)
1 parent 122778a commit 3499cbf

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

tools/mochaRunner/src/main.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,12 @@ function getApplicableTestSuites(
7272
async function main() {
7373
const noCoverage = process.argv.indexOf('--no-coverage') !== -1;
7474

75+
const statsFilenameIdx = process.argv.indexOf('--save-stats-to');
76+
let statsFilename = '';
77+
if (statsFilenameIdx !== -1) {
78+
statsFilename = process.argv[statsFilenameIdx + 1] as string;
79+
}
80+
7581
const platform = zPlatform.parse(os.platform());
7682

7783
const expectations = readJSON(
@@ -85,6 +91,9 @@ async function main() {
8591
const applicableSuites = getApplicableTestSuites(parsedSuitesFile, platform);
8692

8793
console.log('Planning to run the following test suites', applicableSuites);
94+
if (statsFilename) {
95+
console.log('Test stats will be saved to', statsFilename);
96+
}
8897

8998
let fail = false;
9099
const recommendations = [];
@@ -116,7 +125,9 @@ async function main() {
116125
const tmpDir = fs.mkdtempSync(
117126
path.join(os.tmpdir(), 'puppeteer-test-runner-')
118127
);
119-
const tmpFilename = path.join(tmpDir, 'output.json');
128+
const tmpFilename = statsFilename
129+
? statsFilename
130+
: path.join(tmpDir, 'output.json');
120131
console.log('Running', JSON.stringify(parameters), tmpFilename);
121132
const args = [
122133
'-u',

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy