Skip to content

Commit 06c999d

Browse files
jackfranklinDevtools-frontend LUCI CQ
authored andcommitted
Screenshots: don't output --update help if in update mode
Small tweak just to remove some of the output; if we are already in update mode, no need to output that to the user. Bug: none Change-Id: Ie3f59feb5fd50dc488cef786013da4b35e968f8a Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6239712 Auto-Submit: Jack Franklin <[email protected]> Reviewed-by: Philip Pfaffe <[email protected]> Commit-Queue: Jack Franklin <[email protected]> Commit-Queue: Philip Pfaffe <[email protected]>
1 parent 401867f commit 06c999d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

test/shared/screenshots.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ const assertScreenshotUnchanged = async (options: ScreenshotAssertionOptions) =>
189189
}
190190

191191
try {
192-
await compare(goldenScreenshotPath, generatedScreenshotPath, maximumDiffThreshold);
192+
await compare(goldenScreenshotPath, generatedScreenshotPath, maximumDiffThreshold, shouldUpdate);
193193
} catch (compareError) {
194194
if (!onBotAndImageNotFound) {
195195
console.log(`=> Test failed. Retrying (retry ${retryCount} of ${maximumRetries} maximum).`);
@@ -275,7 +275,7 @@ async function execImageDiffCommand(cmd: string) {
275275
});
276276
}
277277

278-
async function compare(golden: string, generated: string, maximumDiffThreshold: number) {
278+
async function compare(golden: string, generated: string, maximumDiffThreshold: number, isInDiffUpdateMode: boolean) {
279279
const isOnBot = process.env.LUCI_CONTEXT !== undefined;
280280
if (!isOnBot && process.env.SKIP_SCREENSHOT_COMPARISONS_FOR_FAST_COVERAGE) {
281281
// When checking test coverage locally the tests get sped up significantly
@@ -304,7 +304,7 @@ async function compare(golden: string, generated: string, maximumDiffThreshold:
304304
let debugInfo = '';
305305
if (isOnBot) {
306306
debugInfo = `${base64TestGeneratedImageLog}\n${base64DiffImageLog}\n`;
307-
} else {
307+
} else if (!isInDiffUpdateMode) {
308308
debugInfo = `Run the tests again with --on-diff=update to update all tests that fail.
309309
Only do this if you expected this screenshot to have changed!
310310

0 commit comments

Comments
 (0)