Skip to content
This repository has been archived by the owner on Sep 1, 2021. It is now read-only.

Fails to run on Gitlab CI #70

Open
debjitbis08 opened this issue Aug 24, 2020 · 1 comment
Open

Fails to run on Gitlab CI #70

debjitbis08 opened this issue Aug 24, 2020 · 1 comment

Comments

@debjitbis08
Copy link

debjitbis08 commented Aug 24, 2020

Configurations

jest.config.js

module.exports = {
    setupFiles: ["./test-setup.js"],
    runner: "@jest-runner/electron",
    testEnvironment: "@jest-runner/electron/environment",
    collectCoverageFrom: ["**/*.js", "!**/node_modules/**"],
    coverageReporters: ["text", "lcov"],
    testResultsProcessor: "jest-sonar-reporter"
};

.gitlab-ci.yml

validation:
    stage: validation
    before_script:
        - apt-get update && apt-get install -y xvfb libxtst6 libnss3 libatk-bridge2.0-0 libgtk-3-0 libxss1 libasound2
    script:
        - npm ci --cache .npm --prefer-offline
        - echo "Running tests now"
        - export ELECTRON_DISABLE_SANDBOX=1
        - xvfb-run npm test

package.json

  "scripts": {
    "test": "npm run lint && jest --config ./src/lib-code/jest.config.js",
    "lint": "eslint src/lib-code"
  },
  "devDependencies": {
    "electron": "^9.2.1",
    "jest": "^26.4.0"
  },

Docker image used: node:latest

Output

Fontconfig warning: "/etc/fonts/fonts.conf", line 100: unknown element "blank"
[1071:0819/190428.116634:FATAL:gpu_data_manager_impl_private.cc(439)] GPU process isn't usable. Goodbye.

To solve this I probably need to pass the --disable-gpu flag to electron, but I can't find a way to do it currently. Also, I have read elsewhere that running electron on Gitlab requires the --disable-dev-shm-usage flag but I don't think there is way to pass that parameter currently.

@catdad
Copy link

catdad commented Oct 1, 2020

There are in fact various flags that need to be passed into electron in various different scenarios (CI, docker, wsl, etc.). The way that other systems, like cypress for example, have handled this is by including and extra variable like ELECTRON_EXTRA_LAUNCH_ARGS where we can define any number of arguments. There should be something similar that allows adding any arbitrary flags.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants