summaryrefslogtreecommitdiff
path: root/config/karma.config.js
diff options
context:
space:
mode:
authorMike Greiling <mike@pixelcog.com>2017-06-14 13:58:10 -0500
committerMike Greiling <mike@pixelcog.com>2017-06-14 13:58:10 -0500
commit50b2b3f5f000834144ccf41a4dbe278987b2ef75 (patch)
tree3f8ce5af6695dc9a418c3718e5a6b6fc40960a9f /config/karma.config.js
parentd70be8f83c307869d634ab30d245d996f780c9fd (diff)
downloadgitlab-ce-50b2b3f5f000834144ccf41a4dbe278987b2ef75.tar.gz
add DEBUG flag option to karma config
Diffstat (limited to 'config/karma.config.js')
-rw-r--r--config/karma.config.js23
1 files changed, 17 insertions, 6 deletions
diff --git a/config/karma.config.js b/config/karma.config.js
index ecbd7d4e3e8..978850e5d70 100644
--- a/config/karma.config.js
+++ b/config/karma.config.js
@@ -21,14 +21,16 @@ module.exports = function(config) {
var karmaConfig = {
basePath: ROOT_PATH,
- browsers: ['ChromeHeadlessNoSandbox'],
+ browsers: ['ChromeHeadlessCustom'],
customLaunchers: {
- ChromeHeadlessNoSandbox: {
+ ChromeHeadlessCustom: {
base: 'ChromeHeadless',
- // 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',
+ flags: [
+ // chrome cannot run in sandboxed mode inside a docker container unless it is run with
+ // escalated kernel privileges (e.g. docker run --cap-add=CAP_SYS_ADMIN)
+ '--no-sandbox',
+ ],
}
},
frameworks: ['jasmine'],
@@ -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);
};