I'm on Alpine Linux running JS tests. With `CHROME...
# multiplatform
c
I'm on Alpine Linux running JS tests. With
CHROME_BIN=chromium-browser
however it complains that
Running as root without --no-sandbox is not supported.
. I'm trying to add the
--no-sandbox
option, however I can't add it to
CHROME_BIN
. Is there an option somewhere in the multiplatform plugin to handle this? And if not, what are the solutions?
i
I haven't figured it out just yet but you can put config files in the project directory under the
karma.config.d
directory (create it yourself) or whichever test framework you're using like mocha.config.d etc.
the frontend plugin talks about it here for webpack for instance https://github.com/Kotlin/kotlin-frontend-plugin#webpack-configuration-customization
i
Hi, you can check this thread https://kotlinlang.slack.com/archives/C0B8L3U69/p1583764679215200 Tl;dr you need to use option
useConfigDirectory
. And then you need to create folder
<http://karma.com|karma.com>fig.d
where you can create plain js files, in which you can configure karma config via
config
variable, and add your own browser launchers (including
no-sandbox
option). But do you really need to run with super user? If you will run with limited user there isn’t this kind of error
Copy code
kotlin {
 js {
  browser {
   testTask {
    useKarma {
     useConfigDirectory()
    }
   }
  }
 }
}
i
super user is a convenience inside docker images I actually just got it working by realizing I can set flags that get picked up by ubuntu images.
echo "CHROMIUM_FLAGS=\"--no-sandbox --headless --disable-gpu\"" > ~/.chromium-browser.init
your example (patricks, rather) is kind of a bummer as it seems I had been really close to figuring it out reading the plugin source but I couldn't find a way to make it work in a kts file so a little comedy there.
c
Thanks a lot for your replies, I'll try it out ^^
👍 1
106 Views