cypress ci缺少libgtk-x11-2.0.so.0

问题描述 投票:2回答:1

我用圆圈ci运行赛普拉斯。它在使用orb时有效,但事实并非如此。我试图启动我的客户端服务器和节点服务器。好像我在docker容器中缺少一个包或什么的。

我愿意改回来使用cypress orb,但我不知道如何设置它以使两台服务器都运行之前运行cypress/run

> If you are using Docker, we provide containers with all required dependencies installed.
----------

/home/circleci/.cache/Cypress/3.1.5/Cypress/Cypress: error while loading shared libraries: libgtk-x11-2.0.so.0: cannot open shared object file: No such file or directory
----------

Platform: linux (Debian - 8.11)
Cypress Version: 3.1.5

以下是步骤:

docker:
      # specify the version you desire here
      - image: circleci/node:10.8.0
      - image: circleci/postgres:9.6
        environment:
          POSTGRES_USER: postgres
          POSTGRES_DB: dnb
      - image: redis
      - image: cypress/base:10
        environment:
          TERM: xterm
steps:
      - checkout

      - restore_cache:
          keys:
            - v1-deps-{{ .Branch }}-{{ checksum "package.json" }}
            - v1-deps-{{ .Branch }}
            - v1-deps

      - run:
          name: Install Dependencies
          command: npm install

      - save_cache:
          key: v1-deps-{{ .Branch }}-{{ checksum "package.json" }}
          # cache NPM modules and the folder with the Cypress binary
          paths:
            - ~/.npm
            - ~/.cache

      # - run:
      #     name: Run test
      #     command: npm test -- --coverage --forceExit --detectOpenHandles --maxWorkers=10
      #     no_output_timeout: 3m

      # - run:
      #     name: Send codecov coverage report
      #     command: bash <(curl -s https://codecov.io/bash) -f coverage/lcov.info -t

      - run:
          name: run client server
          command: npm start
          background: true

      - run:
          name: Pull server
          command: cd && git clone ....git && ls

      - run:
          name: run node server
          command: cd && cd ..i && npm install && npm run dev:prepare && npm start
          background: true

      - run: npm run cypress:run
docker circleci cypress
1个回答
1
投票

你实际上并没有在cypress/base:10 docker图像中执行cypress。

CircleCI docs for multiple images

在多图像配置作业中,所有步骤都在列出的第一个图像创建的容器中执行。

你应该试试这个:

docker:
  # specify the version you desire here
      - image: cypress/base:10
        environment:
          TERM: xterm
      - image: circleci/postgres:9.6
        environment:
          POSTGRES_USER: postgres
          POSTGRES_DB: dnb
      - image: redis
© www.soinside.com 2019 - 2024. All rights reserved.