Skip to content

Commit

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

* Revert "Revert "🏗 Update @percy/percy-puppeteer to v1.x (ampproject#25176)" (ampproject#25213)"

This reverts commit d134d30.

* Do not expect a build when running with --empty
  • Loading branch information
danielrozenberg authored and joshuarrrr committed Oct 23, 2019
1 parent a0a7d2a commit e678c29
Show file tree
Hide file tree
Showing 8 changed files with 1,155 additions and 1,222 deletions.
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ test/coverage
*.swp
*.swo
yarn-error.log
PERCY_BUILD_ID
chromedriver.log
sc-*-linux*
sc-*-osx*
sauce_connect_*
Expand Down
7 changes: 3 additions & 4 deletions build-system/common/exec.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@

const childProcess = require('child_process');

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

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

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

/**
Expand Down
12 changes: 3 additions & 9 deletions build-system/tasks/visual-diff/helpers.js
Original file line number Diff line number Diff line change
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,10 +54,9 @@ function escapeHtml(html) {
function log(mode, ...messages) {
switch (mode) {
case 'verbose':
if (isTravisBuild()) {
return;
if (argv.verbose) {
fancyLog.info(colors.green('VERBOSE:'), ...messages);
}
fancyLog.info(colors.green('VERBOSE:'), ...messages);
break;
case 'info':
fancyLog.info(colors.green('INFO:'), ...messages);
Expand All @@ -72,11 +71,6 @@ 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
Loading

0 comments on commit e678c29

Please sign in to comment.