run chrome with --no-sandbox flag to get around docker privilege limitations

This commit is contained in:
Mike Greiling 2017-06-14 03:00:29 -05:00
parent 3757703165
commit d70be8f83c
2 changed files with 5 additions and 7 deletions

View file

@ -448,16 +448,13 @@ karma:
<<: *except-docs <<: *except-docs
variables: variables:
BABEL_ENV: "coverage" BABEL_ENV: "coverage"
CHROME_LOG_FILE: "chrome_debug.log"
script: script:
- bundle exec rake karma - bundle exec rake karma
coverage: '/^Statements *: (\d+\.\d+%)/' coverage: '/^Statements *: (\d+\.\d+%)/'
artifacts: artifacts:
name: coverage-javascript name: coverage-javascript
expire_in: 31d expire_in: 31d
when: always
paths: paths:
- chrome_debug.log
- coverage-javascript/ - coverage-javascript/
coverage: coverage:

View file

@ -21,11 +21,13 @@ module.exports = function(config) {
var karmaConfig = { var karmaConfig = {
basePath: ROOT_PATH, basePath: ROOT_PATH,
browsers: ['ChromeDebug'], browsers: ['ChromeHeadlessNoSandbox'],
customLaunchers: { customLaunchers: {
ChromeDebug: { ChromeHeadlessNoSandbox: {
base: 'ChromeHeadless', base: 'ChromeHeadless',
flags: ['--enable-logging', '--v=1'], // chrome cannot run in sandboxed mode inside a docker container unless it is run with
// escalated kernel privileges: docker run --cap-add=CAP_SYS_ADMIN
flags: ['--no-sandbox'],
displayName: 'Chrome' displayName: 'Chrome'
} }
}, },
@ -40,7 +42,6 @@ module.exports = function(config) {
reporters: [progressReporter], reporters: [progressReporter],
webpack: webpackConfig, webpack: webpackConfig,
webpackMiddleware: { stats: 'errors-only' }, webpackMiddleware: { stats: 'errors-only' },
logLevel: config.LOG_DEBUG,
}; };
if (process.env.BABEL_ENV === 'coverage' || process.env.NODE_ENV === 'coverage') { if (process.env.BABEL_ENV === 'coverage' || process.env.NODE_ENV === 'coverage') {