From f93edb729726c02c3077519022537841001e8f32 Mon Sep 17 00:00:00 2001
From: Ryan Senior <ryan@metabase.com>
Date: Wed, 3 Oct 2018 15:31:51 -0500
Subject: [PATCH] Fix a docker/chome karma test config issue

When running tests in a docker container as root you'll get the
following error "Running as root without --no-sandbox is not
supported". Adding the `--no-sandbox` flag to the invocation fixes it.
---
 frontend/test/karma.conf.js | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/frontend/test/karma.conf.js b/frontend/test/karma.conf.js
index 07d47226eae..37ab35a534d 100644
--- a/frontend/test/karma.conf.js
+++ b/frontend/test/karma.conf.js
@@ -41,7 +41,15 @@ module.exports = function(config) {
     port: 9876,
     colors: true,
     logLevel: config.LOG_INFO,
-    browsers: ["Chrome"],
+    // The --no-sandbox below is to fix issues running in docker, running Chrome as root
+    // https://github.com/karma-runner/karma-chrome-launcher/issues/158
+    browsers: ["ChromeHeadlessNoSandbox"],
+    customLaunchers: {
+      ChromeHeadlessNoSandbox: {
+        base: "ChromeHeadless",
+        flags: ["--no-sandbox"],
+      },
+    },
     autoWatch: true,
     singleRun: false,
   });
-- 
GitLab