Skip to content

Commit

Permalink
Revert "🏗 Update @percy/percy-puppeteer to v1.x (ampproject#25176)" (a…
Browse files Browse the repository at this point in the history
…mpproject#25213)

This reverts commit 7a0a66f.
  • Loading branch information
estherkim authored and joshuarrrr committed Oct 23, 2019
1 parent 1f1cf2f commit 5059332
Show file tree
Hide file tree
Showing 8 changed files with 1,222 additions and 1,151 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Expand Up @@ -21,6 +21,8 @@ test/coverage
*.swp
*.swo
yarn-error.log
PERCY_BUILD_ID
chromedriver.log
sc-*-linux*
sc-*-osx*
sauce_connect_*
Expand Down
7 changes: 4 additions & 3 deletions build-system/common/exec.js
Expand Up @@ -21,7 +21,8 @@

const childProcess = require('child_process');

const shellCmd = process.platform == 'win32' ? 'cmd' : '/bin/bash';
const shellCmd = process.platform == 'win32' ? 'cmd' : '/bin/sh';
const shellFlag = process.platform == 'win32' ? '/C' : '-c';

/**
* Spawns the given command in a child process with the given options.
Expand All @@ -31,7 +32,7 @@ const shellCmd = process.platform == 'win32' ? 'cmd' : '/bin/bash';
* @return {!Object}
*/
function spawnProcess(cmd, options) {
return childProcess.spawnSync(cmd, Object.assign({shell: shellCmd}, options));
return childProcess.spawnSync(shellCmd, [shellFlag, cmd], options);
}

/**
Expand All @@ -55,7 +56,7 @@ function exec(cmd, options) {
* @return {!Object}
*/
function execScriptAsync(script, options) {
return childProcess.spawn(script, Object.assign({shell: shellCmd}, options));
return childProcess.spawn(shellCmd, [shellFlag, script], options);
}

/**
Expand Down
12 changes: 9 additions & 3 deletions build-system/tasks/visual-diff/helpers.js
Expand Up @@ -15,10 +15,10 @@
*/
'use strict';

const argv = require('minimist')(process.argv.slice(2));
const colors = require('ansi-colors');
const fancyLog = require('fancy-log');
const sleep = require('sleep-promise');
const {isTravisBuild} = require('../../common/travis');

const CSS_SELECTOR_RETRY_MS = 200;
const CSS_SELECTOR_RETRY_ATTEMPTS = 50;
Expand Down Expand Up @@ -54,9 +54,10 @@ function escapeHtml(html) {
function log(mode, ...messages) {
switch (mode) {
case 'verbose':
if (argv.verbose) {
fancyLog.info(colors.green('VERBOSE:'), ...messages);
if (isTravisBuild()) {
return;
}
fancyLog.info(colors.green('VERBOSE:'), ...messages);
break;
case 'info':
fancyLog.info(colors.green('INFO:'), ...messages);
Expand All @@ -71,6 +72,11 @@ function log(mode, ...messages) {
process.exitCode = 1;
fancyLog.error(colors.red('FATAL:'), ...messages);
throw new Error(messages.join(' '));
case 'travis':
if (isTravisBuild()) {
messages.forEach(message => process.stdout.write(message));
}
break;
}
}

Expand Down

0 comments on commit 5059332

Please sign in to comment.