Good Evening, I am trying to implement Gitlab CI/CD using the Angular ng test command. The pipeline runs,
but hangs. I know Karma uses chrome. I am not sure what to add. Any help is appreciated thank you.
image: node:latest before_script: - apt-get update -qy - apt-get install -y ruby-dev - gem install dpl - npm link @angular/cli stages: - test - production unit-test: stage: test image: trion/ng-cli-karma:${CLI_VERSION} script: - npm install - ng test only: - master production: type: deploy stage: production image: ruby:latest script: - dpl --provider=heroku --app=$HEROKU_APP_PRODUCTION --api-key=$HEROKU_API_KEY only: - master
Do the tests run and then the pipeline hangs? If that is the case, I bet it is because ng test
runs in watch mode and is always running looking for changes.
To fix it, change ng test
to ng test --watch=false --browsers=ChromeHeadless
.
I changed the browser to be headless Chrome as well (optional) and this should bring a slight increase in speed in your CI/CD
The flags can be found here .
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.