Skip to content

Commit

Permalink
🏗 Pin the Chromium version used by visual diff to 78.0.3904.0 (#32554)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielrozenberg committed Feb 9, 2021
1 parent b02cf8b commit c03c2a0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
5 changes: 3 additions & 2 deletions build-system/common/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,15 +146,16 @@ function usesFilesOrLocalChanges(taskName) {
* Runs 'npm install' to install packages in a given directory.
*
* @param {string} dir
* @param {?NodeJS.ProcessEnv} options
*/
function installPackages(dir) {
function installPackages(dir, options = {}) {
log(
'Running',
cyan('npm install'),
'to install packages in',
cyan(path.relative(ROOT_DIR, dir)) + '...'
);
execOrDie(`npm install --prefix ${dir}`, {'stdio': 'ignore'});
execOrDie(`npm install --prefix ${dir}`, {'stdio': 'ignore', ...options});
}

module.exports = {
Expand Down
8 changes: 7 additions & 1 deletion build-system/tasks/visual-diff/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@ const percyCss = [
'.i-amphtml-new-loader * { animation: none !important; }',
].join('\n');

// Pin the version of Chromium to 78.0.3904.0, same as the one running on Percy.
// Use https://omahaproxy.appspot.com/ to convert version<->revision numbers.
// REPEATING TODO(@ampproject/wg-infra): keep this pinned with Percy whenever we
// update the version of Chrome in the project settings.
const INSTALL_PACKAGE_OPTIONS = {'PUPPETEER_CHROMIUM_REVISION': '693954'};

const SNAPSHOT_SINGLE_BUILD_OPTIONS = {
widths: [375],
};
Expand Down Expand Up @@ -789,7 +795,7 @@ async function ensureOrBuildAmpRuntimeInTestMode_() {

function installPercy_() {
if (!argv.noinstall) {
installPackages(__dirname);
installPackages(__dirname, INSTALL_PACKAGE_OPTIONS);
}

puppeteer = require('puppeteer');
Expand Down

0 comments on commit c03c2a0

Please sign in to comment.