teracyhq / docker-files

Teracy docker-files project to build common Docker images
https://hub.docker.com/r/teracy/
MIT License
92 stars 55 forks source link

Can't seem to get Chrome to start on Circle CI #56

Closed KyleBastien closed 5 years ago

KyleBastien commented 5 years ago

Whenever I try and run ng test from CircleCI I get the following:

$ ng test ng-fabric-ui --browsers=Chrome_no_sandbox --watch=false --code-coverage
  0% compiling 10% building 0/0 modules 0 active 10% building 0/1 modules 1 active ...gular-cli-files/models/jit-polyfills.js                                            10% building 1/1 modules 0 active22 01 2019 22:47:27.674:INFO [karma-server]: Karma v3.1.4 server started at http://0.0.0.0:9876/
22 01 2019 22:47:27.675:INFO [launcher]: Launching browsers Chrome_no_sandbox with concurrency unlimited
22 01 2019 22:47:27.679:INFO [launcher]: Starting browser Chrome
 10% building 1/2 modules 1 active ...gular-cli-files/models/jit-polyfills.js                                            10% building 2/2 modules 0 active 10% building 2/3 modules 1 active .../repo/projects/ng-fabric-ui/src/test.ts                                            10% building 3/3 modules 0 active 10% building 3/4 modules 1 active ...cts/ng-fabric-ui/src sync /\.spec\.ts$/22 01 2019 22:47:27.959:ERROR [launcher]: Cannot start Chrome

(google-chrome:145): Gtk-WARNING **: cannot open display: :99.0
[0122/224727.833030:ERROR:nacl_helper_linux.cc(310)] NaCl helper process running without a sandbox!
Most likely you need to configure your SUID sandbox correctly

I have already configured the customLaunchers like so:

customLaunchers: {
  Chrome_no_sandbox: {
    base: 'Chrome',
    flags: ['--no-sandbox', '--disable-setuid-sandbox', '--disable-gpu'] // for running within Docker
  }
}

But still no luck, any help would be appreciated.

hoatle commented 5 years ago

@KyleMcNutt thank you for your report, we'll check on this soon.

hoatle commented 5 years ago

@datphan make sure to check on this asap

datphan commented 5 years ago

I run with this project: https://github.com/teracyhq-incubator/angular-boilerplate and it seem to works

root@3e5225594cdb:/opt/app# ng test ng-fabric-ui --browsers=Chrome_no_sandbox --watch=false --code-coverage
12 02 2019 04:42:59.813:INFO [karma]: Karma v1.4.1 server started at http://0.0.0.0:9876/
12 02 2019 04:42:59.816:INFO [launcher]: Launching browser Chrome_no_sandbox with unlimited concurrency
12 02 2019 04:42:59.893:INFO [launcher]: Starting browser Chrome
12 02 2019 04:43:01.028:INFO [Chrome 57.0.2987 (Linux 0.0.0)]: Connected on socket D8WP5kZPxNiIO-p2AAAA with id 24040619
Chrome 57.0.2987 (Linux 0.0.0): Executed 3 of 3 SUCCESS (0.264 secs / 0.253 secs)

Not sure what your config is, make sure to follow these configs https://github.com/teracyhq-incubator/angular-boilerplate/blob/master/karma.conf.js#L42 https://github.com/teracyhq-incubator/angular-boilerplate/blob/master/protractor.conf.js#L13

KyleBastien commented 5 years ago

Hi @datphan I've pasted the associated config above, more than willing to paste the whole thing.

Did you try this in CircleCI?

datphan commented 5 years ago

@KyleMcNutt Maybe your config is not correct? I'm testing with circleci/node:8.9.3-browsers:

version: 2
jobs:
  build:
    working_directory: ~/project1
    docker:
      - image: circleci/node:8.9.3-browsers

and it seem working

#!/bin/bash -eo pipefail
xvfb-run -a npm run test

> angular-boilerplate@0.2.0 test /home/circleci/project1
> ng test --browsers Chrome_no_sandbox --watch false

  0% compiling 10% building 0/0 modules 0 active 10% building 0/1 modules 1 active ...gular-cli-files/models/jit-polyfills.js                                            10% building 1/1 modules 0 active 10% building 1/2 modules 1 active .../home/circleci/project1/src/styles.scss                                            10% building 2/2 modules 0 active13 02 2019 05:19:26.944:INFO [karma]: Karma v1.4.1 server started at http://0.0.0.0:9876/
13 02 2019 05:19:26.945:INFO [launcher]: Launching browser Chrome_no_sandbox with unlimited concurrency
13 02 2019 05:19:26.950:INFO [launcher]: Starting browser Chrome
 10% building 2/3 modules 1 active ...gular-cli-files/models/jit-polyfills.js   
....
hoatle commented 5 years ago

it should work on Circle CI, closed then.