Commit 50b2b3f5 authored by Mike Greiling's avatar Mike Greiling

add DEBUG flag option to karma config

parent d70be8f8
...@@ -448,13 +448,16 @@ karma: ...@@ -448,13 +448,16 @@ karma:
<<: *except-docs <<: *except-docs
variables: variables:
BABEL_ENV: "coverage" BABEL_ENV: "coverage"
DEBUG: "true"
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:
......
...@@ -21,14 +21,16 @@ module.exports = function(config) { ...@@ -21,14 +21,16 @@ module.exports = function(config) {
var karmaConfig = { var karmaConfig = {
basePath: ROOT_PATH, basePath: ROOT_PATH,
browsers: ['ChromeHeadlessNoSandbox'], browsers: ['ChromeHeadlessCustom'],
customLaunchers: { customLaunchers: {
ChromeHeadlessNoSandbox: { ChromeHeadlessCustom: {
base: 'ChromeHeadless', base: 'ChromeHeadless',
displayName: 'Chrome',
flags: [
// chrome cannot run in sandboxed mode inside a docker container unless it is run with // 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 // escalated kernel privileges (e.g. docker run --cap-add=CAP_SYS_ADMIN)
flags: ['--no-sandbox'], '--no-sandbox',
displayName: 'Chrome' ],
} }
}, },
frameworks: ['jasmine'], frameworks: ['jasmine'],
...@@ -54,5 +56,14 @@ module.exports = function(config) { ...@@ -54,5 +56,14 @@ module.exports = function(config) {
}; };
} }
if (process.env.DEBUG) {
karmaConfig.logLevel = config.LOG_DEBUG;
process.env.CHROME_LOG_FILE = process.env.CHROME_LOG_FILE || 'chrome_debug.log';
}
if (process.env.CHROME_LOG_FILE) {
karmaConfig.customLaunchers.ChromeHeadlessCustom.flags.push('--enable-logging', '--v=1');
}
config.set(karmaConfig); config.set(karmaConfig);
}; };
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment