Skip to content

Commit 1d5c175

Browse files
Merge pull request #784 from alphagov/fix-chrome-headless-ci
2 parents 96bf629 + e37cf34 commit 1d5c175

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

test/karma.config.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,16 @@ module.exports = function (config) {
1414
frameworks: ['mocha', 'webpack'],
1515
reporters: ['mocha'],
1616

17-
browsers: ['ChromeHeadless'],
17+
// Chrome won't run on CI unless the `--no-sandbox` and `--disable-setuid-sandbox` flags are applied
18+
// Karma's Chrome Headless seems based on Puppeteer and runs into this issue:
19+
// https://github.com/Googlechrome/puppeteer/issues/290
20+
browsers: ['ChromeHeadlessNoSandbox'],
21+
customLaunchers: {
22+
ChromeHeadlessNoSandbox: {
23+
base: 'ChromeHeadless',
24+
flags: ['--no-sandbox', '--disable-setuid-sandbox']
25+
}
26+
},
1827

1928
files: [
2029
'test/functional/**/*.js'

test/wdio.config.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,10 @@ const capabilitiesLocal = [
2424
{
2525
browserName: 'chrome',
2626
'goog:chromeOptions': {
27-
args: ['--headless=new'],
27+
// Chrome won't run on CI unless the `--no-sandbox` and `--disable-setuid-sandbox` flags are applied
28+
// otherwise, it runs into the same kind of issue as Karma and Puppeteer:
29+
// https://github.com/Googlechrome/puppeteer/issues/290
30+
args: ['--headless=new', '--no-sandbox', '--disable-setuid-sandbox'],
2831
binary: puppeteer.executablePath()
2932
}
3033
}

0 commit comments

Comments
 (0)