Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🏗 gulp visual-diff refactor and stability fixes #19327

Merged

Conversation

danielrozenberg
Copy link
Member

@danielrozenberg danielrozenberg commented Nov 14, 2018

Fixes:

  • Ensure that the webServerProcess_ is defined before checking whether the process was killed, in the cleanup step
  • Added a workaround to the MaxListenersExceededWarning that gets thrown by Node due to Puppeteer adding too many Disconnect listeners

Minor changes:

  • Fatal log errors will throw an exception (that will be caught by task runner) instead of explicitly calling process.exit
  • Call cleanup_ on unhandled Promise rejections as well
  • Refactored steps into smaller functions

New stuff:

  • Ensure that AMP was build with --fortesting when running visual diff tests

rsimha
rsimha previously approved these changes Nov 14, 2018
const isInTestMode = /AMP_CONFIG=\{(?:.+,)?"test":true\b/.test(
fs.readFileSync('dist/amp.js', 'utf8'));
if (!isInTestMode) {
log('fatal', 'AMP was not build in test mode. Run',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: "The AMP runtime was not built in test mode."

@danielrozenberg danielrozenberg changed the title 🏗 Ensure that AMP was build with --fortesting when running visual diff tests 🏗 gulp visual-diff refactor and stability fixes Nov 15, 2018
@danielrozenberg danielrozenberg dismissed rsimha’s stale review November 15, 2018 19:21

This PR now includes multiple changes that weren't part of the original PR. Please take another look!

@danielrozenberg danielrozenberg merged commit d7fc907 into ampproject:master Nov 15, 2018
@danielrozenberg danielrozenberg deleted the visual-diffs-build-with-test branch November 15, 2018 19:54
@rsimha
Copy link
Contributor

rsimha commented Nov 16, 2018

@danielrozenberg
Copy link
Member Author

Seems like an unrelated flaky test. I'll mark it flaky and assign Jon to fix

@rsimha
Copy link
Contributor

rsimha commented Nov 16, 2018

The real problem I was pointing to was the message below.

No output has been received in the last 10m0s, this potentially indicates a stalled build or something wrong with the build itself.

If a visual test flakes, the Travis job should exit cleanly and immediately, shouldn't it? I suspect this has to do with the instances of process.exit(1) that were removed in this PR.

@danielrozenberg
Copy link
Member Author

Ah I see. I'll create a new issue for this

Enriqe pushed a commit to Enriqe/amphtml that referenced this pull request Nov 28, 2018
* Ensure that AMP was build with `--fortesting` when running visual diff tests

* Address text nit

* Add visual diff file to whitelist of files allowed to use AMP_CONFIG directly

* Rewrite the log helper function to use appropriate streams, and throw an exception instead of process.exit'ing

* Rename preVisualDiffTasks to ensureOrBuildAmpRuntimeInTestMode_ and call it explicitly, instead of as a pre-task in gulp

* Cleanup after an unhandled Promise rejection

* Cleanup should validate that the webServerProcess_ object exists before checking if it was killed

* Refactor task into smaller functions

* Add a workaround to the MaxListenersExceededWarning thrown by Node
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants