I am learning how to use GitLab CI / CD. My example project is a boilerplate VueJS App.
I have unit testing, docker builds and push to registry working, but I am struggling with Cypress e2e testing.
The e2e tests hang when verifying cypress and the test never ends. Here is the output of log.
Running with gitlab-runner 13.8.0 (775dd39d)
on Cypress/base:14.15.4 GGTzNUZr
Preparing the "docker" executor
Using Docker executor with image cypress/base:14.15.4 ...
Pulling docker image cypress/base:14.15.4 ...
Using docker image sha256:7bdb668124f5113a85870e35e904cda83549e6d2953493b1a3f566f63b242161 for cypress/base:14.15.4 with digest cypress/base@sha256:dad8727e107f61f48a3c6ef22cb651069cfd29fd377addcfbd7986c0a2659903 ...
Preparing environment
00:01
Running on runner-ggtznuzr-project-5-concurrent-0 via a467d812c00c...
Getting source from Git repository
00:01
Fetching changes with git depth set to 50...
Initialized empty Git repository in /builds/learning/gitlab/vuejs_devops/.git/
Created fresh repository.
Checking out 127f8b87 as master...
Skipping Git submodules setup
Executing "step_script" stage of the job script
$ npm install
> nodent-runtime@3.2.1 install /builds/learning/gitlab/vuejs_devops/node_modules/nodent-runtime
> node build.js
## Built /builds/learning/gitlab/vuejs_devops/node_modules/nodent-runtime/dist/index.js
> yorkie@2.0.0 install /builds/learning/gitlab/vuejs_devops/node_modules/yorkie
> node bin/install.js
CI detected, skipping Git hooks installation
> node-sass@4.14.1 install /builds/learning/gitlab/vuejs_devops/node_modules/node-sass
> node scripts/install.js
Downloading binary from https://github.com/sass/node-sass/releases/download/v4.14.1/linux-x64-83_binding.node
Download complete
Binary saved to /builds/learning/gitlab/vuejs_devops/node_modules/node-sass/vendor/linux-x64-83/binding.node
Caching binary to /root/.npm/node-sass/4.14.1/linux-x64-83_binding.node
> core-js@2.6.12 postinstall /builds/learning/gitlab/vuejs_devops/node_modules/@babel/runtime-corejs2/node_modules/core-js
> node -e "try{require('./postinstall')}catch(e){}"
> core-js@3.8.3 postinstall /builds/learning/gitlab/vuejs_devops/node_modules/core-js
> node -e "try{require('./postinstall')}catch(e){}"
> ejs@2.7.4 postinstall /builds/learning/gitlab/vuejs_devops/node_modules/ejs
> node ./postinstall.js
> cypress@3.8.3 postinstall /builds/learning/gitlab/vuejs_devops/node_modules/cypress
> node index.js --exec install
[08:07:00] Downloading Cypress [started]
[08:07:03] Downloading Cypress [completed]
[08:07:03] Unzipping Cypress [started]
[08:07:08] Unzipping Cypress [completed]
[08:07:08] Finishing Installation [started]
[08:07:08] Finishing Installation [completed]
> node-sass@4.14.1 postinstall /builds/learning/gitlab/vuejs_devops/node_modules/node-sass
> node scripts/build.js
Binary found at /builds/learning/gitlab/vuejs_devops/node_modules/node-sass/vendor/linux-x64-83/binding.node
Testing binary
Binary is fine
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules/webpack-dev-server/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules/watchpack-chokidar2/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules/mochapack/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.3.1 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.1: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
added 1610 packages from 1535 contributors and audited 1617 packages in 30.945s
72 packages are looking for funding
run `npm fund` for details
found 3 low severity vulnerabilities
run `npm audit fix` to fix them, or `npm audit` for details
$ npm run test:unit
> cicd_test@0.1.0 test:unit /builds/learning/gitlab/vuejs_devops
> vue-cli-service test:unit
Download the Vue Devtools extension for a better development experience:
https://github.com/vuejs/vue-devtools
You are running Vue in development mode.
Make sure to turn on production mode when deploying for production.
See more tips at https://vuejs.org/guide/deployment.html
WEBPACK Compiling...
DONE Compiled successfully in 2532ms
WEBPACK Compiled successfully in 2532ms
MOCHA Testing...
HelloWorld.vue
✓ renders props.msg when passed
1 passing (24ms)
MOCHA Tests completed successfully
$ npm run test:e2e
> cicd_test@0.1.0 test:e2e /builds/learning/gitlab/vuejs_devops
> vue-cli-service test:e2e
INFO Starting e2e tests...
INFO Starting development server...
DONE Compiled successfully in 5366ms8:07:24 AM
App running at:
- Local: http://localhost:8080/
It seems you are running Vue CLI inside a container.
Access the dev server via http://localhost:<your container's external mapped port>/
App is served in production mode.
Note this is for preview or E2E testing only.
[08:07:24] Verifying Cypress can run /root/.cache/Cypress/3.8.3/Cypress [started]
[08:07:26] Verifying Cypress can run /root/.cache/Cypress/3.8.3/Cypress [completed]
At the time of writing this issue, it had been in the Verifying state for 25 minutes
Here is my .gitlab-ci.yml
file
stages:
- test
- build
test:
stage: test
tags:
- e2e-test
script:
- npm install
- npm run test:unit
- npm run test:e2e
docker-build:
tags:
- DOCKER
image: docker:latest
stage: build
services:
- docker:dind
before_script:
- echo $CI_BUILD_TOKEN | docker login -u "$CI_REGISTRY_USER" --password-stdin $CI_REGISTRY
script:
- docker build --pull -t "$CI_REGISTRY_IMAGE" .
- docker push "$CI_REGISTRY_IMAGE"
My GitLab runner is using a docker image version cypress/base:14.15.4
although I have also tried cypress/base:10
Aucun commentaire:
Enregistrer un commentaire