0

下面是我的管道,我试图让 Cypress 工作来运行针对 Nginx 服务(指向主应用程序)的测试,该服务是在build阶段构建的 下面基于来自这里的官方模板https://gitlab.com /cypress-io/cypress-example-docker-gitlab/-/blob/master/.gitlab-ci.yml

image: docker:stable

services: 
   - docker:dind

stages: 
   - build
   - test

cache:
   key: ${CI_COMMIT_REF_SLUG}
   paths:      
      - .npm    
      - cache/Cypress                                      
      - node_modules                                                             

job:                              
   stage: build                                           
   script:                                                                      
     - export REACT_APP_USERS_SERVICE_URL=http://127.0.0.1
     - apk add --update --no-cache gcc g++ make python2 python2-dev py-pip python3-dev docker-compose npm
     - docker-compose up -d --build

e2e:                                                                           
   image: cypress/included:9.1.1                                                
   stage: test
   script:
      - export CYPRESS_VIDEO=false            
      - export CYPRESS_baseUrl=http://nginx:80                                   
      - npm i randomstring
      - $(npm bin)/cypress run -t -v $PWD/e2e -w /e2e -e CYPRESS_VIDEO -e CYPRESS_baseUrl --network testdriven_default
      - docker-compose down

错误输出:

Cypress encountered an error while parsing the argument config
You passed: if [ -x /usr/local/bin/bash ]; then
    exec /usr/local/bin/bash 
elif [ -x /usr/bin/bash ]; then
    exec /usr/bin/bash 
elif [ -x /bin/bash ]; then
    exec /bin/bash 
elif [ -x /usr/local/bin/sh ]; then
    exec /usr/local/bin/sh 
elif [ -x /usr/bin/sh ]; then
    exec /usr/bin/sh 
elif [ -x /bin/sh ]; then
    exec /bin/sh 
elif [ -x /busybox/sh ]; then
    exec /busybox/sh 
else
    echo shell not found
    exit 1
fi
The error was: Cannot read properties of undefined (reading 'split')

这个设置有什么问题?

4

0 回答 0