Skip to content

Commit 2b2848d

Browse files
committed
[code-infra] Improve Argos script debuggability
1 parent 785e720 commit 2b2848d

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

scripts/pushArgos.mjs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,32 @@ import glob from 'fast-glob';
33
import fse from 'fs-extra';
44
import lodashChunk from 'lodash/chunk.js';
55
import { upload } from '@argos-ci/core';
6+
import yargs from 'yargs';
67

78
const screenshotsBase = 'test/regressions/screenshots/chrome';
89
const screenshotsPigmentCSSBase = 'screenshots/chrome';
910
const screenshotsTmp = 'test/regressions/screenshots/argos';
1011
const BATCH_SIZE = 200;
1112

13+
const argv = yargs(process.argv.slice(2)).option('verbose', {
14+
alias: 'v',
15+
type: 'boolean',
16+
description: 'Run with verbose logging',
17+
}).argv;
18+
1219
async function run() {
1320
const emotionScreenshots = await glob(`${screenshotsBase}/**/*`);
1421
const pigmentCSSScnreeshots = await glob(`${screenshotsPigmentCSSBase}/**/*`);
1522
const screenshots = [...emotionScreenshots, ...pigmentCSSScnreeshots];
23+
24+
console.log(`Found ${screenshots.length} screenshots.`);
25+
if (argv.verbose) {
26+
console.log('Screenshots found:');
27+
screenshots.forEach((screenshot) => {
28+
console.log(` - ${screenshot}`);
29+
});
30+
}
31+
1632
const chunks = lodashChunk(screenshots, BATCH_SIZE);
1733

1834
await Promise.all(

0 commit comments

Comments
 (0)