如何解决CI 开发服务器未启动
在 Circle CI 中运行 Cypress Orb 时,我的 Node 服务器没有启动。任何想法我错过了什么? (它在 Circle 环境之外本地工作)
我已经使用 cypress 设置了一个简单的集成测试,并在 package.json 中定义了两个命令以便能够执行它。
@H_502_4@npm run cy:startserver
npm run cy:run
这些命令设置了一些在启动时需要运行测试的标志。
"cy:run": "cypress run","cy:startserver": "MOCK_ARTICLES=1 CONTENT_CACHE_URL= node server/index.js"
运行这两个命令输出
Spec Tests Passing Failing Pending Skipped
┌────────────────────────────────────────────────────────────────────────────────────────────────┐
│ ✔ article.spec.js 00:03 2 2 - - - │
└────────────────────────────────────────────────────────────────────────────────────────────────┘
✔ All specs passed! 00:03 2 2 - - -
在 Circle CI 配置中,我定义了 Cypress Orb 并传入了启动命令和等待。
version: 2.1
orbs:
node: circleci/[email protected]
cypress: cypress-io/cypress@1
...
jobs:
- cypress/run:
start: npm run cy:startserver
wait-on: 'http://127.0.0.1:3000'
但是在本地和远程运行作业时,服务器永远不会启动。
我正在运行的命令是 circleci local execute --job cypress/run
====>> Wait-on http://127.0.0.1:3000
#!/bin/bash -eo pipefail
npx wait-on http://127.0.0.1:3000
Error:
Too long with no output (exceeded 10m0s): context deadline exceeded
Step timedout
Step canceled
Error: runner Failed (exited with 101)
Task Failed
Error: task Failed
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。