Skip to content

Commit e35fec0

Browse files
committed
Fixes tests for GitHub actions.
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.
1 parent 4334db0 commit e35fec0

File tree

3 files changed

+70
-72
lines changed

3 files changed

+70
-72
lines changed

package-lock.json

+61-61
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@
4040
"@netflix/eslint-config": "3.0.0",
4141
"@netflix/x-test": "1.0.2",
4242
"eslint-plugin-jsdoc": "50.6.3",
43-
"eslint": "9.20.1",
44-
"puppeteer": "24.2.1",
43+
"eslint": "9.21.0",
44+
"puppeteer": "24.3.0",
4545
"tap-parser": "18.0.0",
46-
"typescript": "5.7.3"
46+
"typescript": "5.8.2"
4747
},
4848
"engines": {
4949
"node": ">=22.14",

test.js

+6-8
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,9 @@ import puppeteer from 'puppeteer';
55
// Open our browser.
66
const browser = await puppeteer.launch({
77
timeout: 10000,
8-
// opt-in to the new Chrome headless implementation
9-
// ref: https://developer.chrome.com/articles/new-headless/
10-
headless: 'new',
11-
args: [
12-
// Disables interactive prompt: Do you want to the application Chromium.app to accept incoming network connections?
13-
// ref: https://github.com/puppeteer/puppeteer/issues/4752#issuecomment-586599843
14-
'--disable-features=DialMediaRouteProvider',
15-
],
8+
// These args fix “Error: Failed to launch the browser process!” when
9+
// run in GitHub. We are only running our own code here, so this is ok.
10+
args: ['--no-sandbox', '--disable-setuid-sandbox'],
1611
});
1712
const page = await browser.newPage();
1813

@@ -66,6 +61,9 @@ import puppeteer from 'puppeteer';
6661
// Close our browser.
6762
await browser.close();
6863
} catch (err) {
64+
// Ensure that we “Bail out!” (see TAP specification) if script fails. Note
65+
// that the tap stream is being read on stdout.
66+
console.log('Bail out!'); // eslint-disable-line no-console
6967
// Ensure we exit with a non-zero code if anything fails (e.g., timeout).
7068
console.error(err); // eslint-disable-line no-console
7169
process.exit(1);

0 commit comments

Comments
 (0)