Skip to content

Commit c9aa90f

Browse files
authored
[code-infra] Pass through ARGOS_THRESHOLD variable (#766)
1 parent e79fecf commit c9aa90f

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

packages/code-infra/src/cli/cmdArgosPush.mjs

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,11 @@ export default /** @type {import('yargs').CommandModule<{}, Args>} */ ({
6363
const screenshots = await globby(`${folder}/**/*`, {
6464
onlyFiles: true,
6565
});
66+
const threshold = process.env.ARGOS_THRESHOLD ? parseFloat(process.env.ARGOS_THRESHOLD) : 0.5;
6667

67-
console.log(`Found ${screenshots.length} screenshots.`);
68+
console.log(
69+
`Found ${screenshots.length} screenshots. Uploading with threshold ${threshold}.`,
70+
);
6871
if (verbose) {
6972
console.log('Screenshots found:');
7073
screenshots.forEach((screenshot) => {
@@ -99,14 +102,22 @@ export default /** @type {import('yargs').CommandModule<{}, Args>} */ ({
99102
commit: circleSha1,
100103
branch: circleBranch,
101104
token: argosToken,
105+
threshold,
102106
parallel: {
103107
total: batches.length,
104108
nonce: circleBuildNum,
105109
},
106110
});
107111

112+
if (verbose) {
113+
console.log('Screenshots uploaded:');
114+
for (const screenshot of result.screenshots) {
115+
console.log(`- ${screenshot.name}. Threshold: ${screenshot.threshold}.`);
116+
}
117+
}
118+
108119
console.log(
109-
`Batch of ${batches[i].length} screenshots uploaded. Build URL: ${result.build.url}`,
120+
`Batch of ${batches[i].length} screenshots uploaded. Threshold: ${threshold}. Build URL: ${result.build.url}`,
110121
);
111122
}
112123
} finally {

0 commit comments

Comments
 (0)