From 04fa5e44908ff695dda1fafe583212913967d73d Mon Sep 17 00:00:00 2001 From: Daniel Rozenberg Date: Wed, 27 Sep 2023 17:35:13 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=8F=97=20Fix=20for=20Percy=20changes=20on?= =?UTF-8?q?=20handling=20missing=20snapshots=20(#39503)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build-system/tasks/visual-diff/index.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/build-system/tasks/visual-diff/index.js b/build-system/tasks/visual-diff/index.js index c71a999af954..89e3ccd30b12 100644 --- a/build-system/tasks/visual-diff/index.js +++ b/build-system/tasks/visual-diff/index.js @@ -106,6 +106,9 @@ function maybeOverridePercyEnvironmentVariables() { process.env[variable.toUpperCase()] = argv[variable]; } }); + if (argv.empty) { + process.env['PERCY_PARTIAL_BUILD'] = '1'; + } } /** @@ -571,7 +574,7 @@ function setDebuggingLevel() { * @return {Promise} */ async function createEmptyBuild(browser) { - log('info', 'Skipping visual diff tests and generating a blank Percy build'); + log('info', 'Generating the blank page snapshot'); const page = await newPage(browser); @@ -642,9 +645,7 @@ async function performVisualTests(executablePath) { ); try { - if (argv.empty) { - await createEmptyBuild(browser); - } else { + if (!argv.empty) { // Load and parse the config. Use JSON5 due to JSON comments in file. const visualTestsConfig = JSON5.parse( fs.readFileSync( @@ -657,6 +658,7 @@ async function performVisualTests(executablePath) { ); await runVisualTests(browser, visualTestsConfig.webpages); } + await createEmptyBuild(browser); } finally { await browser.close(); exitCtrlcHandler(handlerProcess);