简体   繁体   English

Gitlab CI/CD 在提交更改时挂起

[英]Gitlab CI/CD hangs when committing changes

Good Evening, I am trying to implement Gitlab CI/CD using the Angular ng test command.晚上好,我正在尝试使用 Angular ng 测试命令来实现 Gitlab CI/CD。 The pipeline runs,管道运行,

but hangs.但挂起。 I know Karma uses chrome.我知道 Karma 使用铬。 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.如果是这种情况,我敢打赌,这是因为ng test在监视模式下运行,并且一直在寻找变化。

To fix it, change ng test to ng test --watch=false --browsers=ChromeHeadless .要修复它,请将ng test更改为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我也将浏览器更改为无头 Chrome(可选),这应该会稍微提高 CI/CD 的速度

The flags can be found here .这些标志可以在这里找到。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM