test: use Chromium (not Chrome) when available
Signed-off-by: Miroslav Bajtoš <mbajtoss@gmail.com>
This commit is contained in:
parent
8311138f3e
commit
387835faef
|
@ -98,7 +98,8 @@
|
||||||
"sinon-chai": "^3.2.0",
|
"sinon-chai": "^3.2.0",
|
||||||
"strong-error-handler": "^3.0.0",
|
"strong-error-handler": "^3.0.0",
|
||||||
"strong-task-emitter": "^0.0.8",
|
"strong-task-emitter": "^0.0.8",
|
||||||
"supertest": "^3.0.0"
|
"supertest": "^3.0.0",
|
||||||
|
"which": "^1.3.1"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const isDocker = require('is-docker');
|
const isDocker = require('is-docker');
|
||||||
|
const which = require('which');
|
||||||
|
|
||||||
// Karma configuration
|
// Karma configuration
|
||||||
// http://karma-runner.github.io/0.12/config/configuration-file.html
|
// http://karma-runner.github.io/0.12/config/configuration-file.html
|
||||||
|
@ -17,10 +18,15 @@ module.exports = function(config) {
|
||||||
console.log('!! Disabling Chrome sandbox to support un-privileged Docker !!');
|
console.log('!! Disabling Chrome sandbox to support un-privileged Docker !!');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const hasChromium =
|
||||||
|
which.sync('chromium-browser', {nothrow: true}) ||
|
||||||
|
which.sync('chromium', {nothrow: true});
|
||||||
|
|
||||||
config.set({
|
config.set({
|
||||||
customLaunchers: {
|
customLaunchers: {
|
||||||
ChromeDocker: {
|
ChromeDocker: {
|
||||||
base: 'ChromeHeadless',
|
// cis-jenkins build server does not provide Chrome, only Chromium
|
||||||
|
base: hasChromium ? 'ChromiumHeadless' : 'ChromeHeadless',
|
||||||
// We must disable the Chrome sandbox when running Chrome inside Docker
|
// We must disable the Chrome sandbox when running Chrome inside Docker
|
||||||
// (Chrome's sandbox needs more permissions than Docker allows by default)
|
// (Chrome's sandbox needs more permissions than Docker allows by default)
|
||||||
// See https://github.com/docker/for-linux/issues/496
|
// See https://github.com/docker/for-linux/issues/496
|
||||||
|
|
Loading…
Reference in New Issue