Skip to content

Commit

Permalink
🏗 Fix for Percy changes on handling missing snapshots (#39503)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielrozenberg authored Sep 27, 2023
1 parent 04aebd8 commit 04fa5e4
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions build-system/tasks/visual-diff/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@ function maybeOverridePercyEnvironmentVariables() {
process.env[variable.toUpperCase()] = argv[variable];
}
});
if (argv.empty) {
process.env['PERCY_PARTIAL_BUILD'] = '1';
}
}

/**
Expand Down Expand Up @@ -571,7 +574,7 @@ function setDebuggingLevel() {
* @return {Promise<void>}
*/
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);

Expand Down Expand Up @@ -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(
Expand All @@ -657,6 +658,7 @@ async function performVisualTests(executablePath) {
);
await runVisualTests(browser, visualTestsConfig.webpages);
}
await createEmptyBuild(browser);
} finally {
await browser.close();
exitCtrlcHandler(handlerProcess);
Expand Down

0 comments on commit 04fa5e4

Please sign in to comment.