-
Notifications
You must be signed in to change notification settings - Fork 14
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
Fixes tests for GitHub actions. #272
Conversation
f17761d
to
7e1c182
Compare
@@ -5,14 +5,9 @@ import puppeteer from 'puppeteer'; | |||
// Open our browser. | |||
const browser = await puppeteer.launch({ | |||
timeout: 10000, | |||
// opt-in to the new Chrome headless implementation | |||
// ref: https://developer.chrome.com/articles/new-headless/ | |||
headless: 'new', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this setting is outdated now?
args: [ | ||
// Disables interactive prompt: Do you want to the application Chromium.app to accept incoming network connections? | ||
// ref: https://github.com/puppeteer/puppeteer/issues/4752#issuecomment-586599843 | ||
'--disable-features=DialMediaRouteProvider', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I checked the linked issue and it seemed like it was closed.
], | ||
// These args fix “Error: Failed to launch the browser process!” when | ||
// run in GitHub. We are only running our own code here, so this is ok. | ||
args: ['--no-sandbox', '--disable-setuid-sandbox'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would love a cross-check on this one. I think this is what we need to do now in GitHub based on our settings?
@klebba — Would you mind taking a look at this? |
See #272 for a discussion on our tests in GH.
See #272 for a discussion on our tests in GH.
7e1c182
to
7b08ace
Compare
Back to passing now that underlying tests are actually fixed (versus just not running at all). |
Previously, the tests weren’t actually being run by GitHub actions for some time now. They would run locally, but the browser would silently fail to launch in GitHub when the action was run. Additionally, we now “Bail out!” within “test.js” if any exceptions are caught — these are magic words that our TAP parser will recognize and they instruct the parser to immediately consider the test a failure.
7b08ace
to
e35fec0
Compare
@@ -66,6 +61,9 @@ import puppeteer from 'puppeteer'; | |||
// Close our browser. | |||
await browser.close(); | |||
} catch (err) { | |||
// Ensure that we “Bail out!” (see TAP specification) if script fails. Note | |||
// that the tap stream is being read on stdout. | |||
console.log('Bail out!'); // eslint-disable-line no-console |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI @klebba — we should bake this sort of thing into all our test.js
files across projects.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LG2M
Previously, the tests weren’t actually being run by GitHub actions for some time now. They would run locally, but the browser would silently fail to launch in GitHub when the action was run.
Additionally, we now “Bail out!” within “test.js” if any exceptions are caught — these are magic words that our TAP parser will recognize and they instruct the parser to immediately consider the test a failure.