Xvfb not working


#1

I’m trying to setup a new project. It’s an electron project with spectron, which runs GUI tests similar to selenium.

My config looks like this:

version: 2
jobs:
  build:
    docker:
      - image: circleci/node:7.10
    working_directory: ~/repo
    steps:
      - checkout
      - restore_cache:
          keys:
          - v1-dependencies-{{ checksum "package.json" }}
          - v1-dependencies-
      - run: npm install
      - save_cache:
          paths:
            - node_modules
          key: v1-dependencies-{{ checksum "package.json" }}
      - run:
          name: Running X virtual framebuffer
          command: Xvfb :99 -screen 0 1280x1024x24
          background: true
      - run: npm test

I get this error:

#!/bin/bash -eo pipefail
Xvfb :99 -screen 0 1280x1024x24
_XSERVTransmkdir: ERROR: euid != 0,directory /tmp/.X11-unix will not be created.
Step was canceled

#2

Can you pull that image to your local machine, and docker exec -it (containername) sh into it, to experiment with stuff? I assume it will be running some sort of shell, so you can have a poke around.

(Aside: please add your logs/errors as text, not images. I was going to copy+paste that error into a search engine, but cannot. Here’s why. Thanks!).


#3

Sorry about that, I’ve updated the question with the text too.


#4

Use the -node-browsers variant of that image and Xvfb will be running

 - image: circleci/node:7.10-node-browsers

#5