背景:我试图在圆环CI上运行Cypress (npx cypress run)。我使用了Cypress Orb,尽管我最近对它进行了扩展以添加更多的故障排除信息。我的设置相当复杂,有5个容器旋转,以提供测试环境。所以,我是在一个循环CI机器上运行的,而不是码头。
问题:使用Cypress测试来查看我的baseUrl是活动的,并发现它不是活着的,但是我可以通过使用curl语句来单独证明它是活着的。我所能想到的是,Cypress没有使用配置好的baseUrl,但是我不知道它是什么,因为它和其他敏感信息一起被屏蔽了。我尝试将-dev标志添加到柏树命令中,但仍然掩盖了这些信息。
下面是我的config.yml中“命令”的相关部分:
grep baseUrl cypress.json
echo -n "curl port 3091: "
curl -s -S -i localhost:3091 | grep -q 'HTTP/1.1 200 OK'
if [ $? -ne 0 ]; then
echo "ran into an error"
curl -i localhost:3091
else
echo "OK"
fi
echo "cypress info:"
npx cypress info --dev
echo "run cypress"
set +e
npx cypress run --dev --browser chrome
if [ $? -ne 0 ]; then
npx cypress run --browser chrome &> cypress-run.log
echo "error, here is the cypress output:"
cat cypress-run.log
exit 1
fi下面是代码的输出,在循环CI上执行:
baseUrl: "baseUrl": "http://localhost:3091",
curl port 3091: OK
cypress info:
Proxy Settings: none detected
Environment Variables:
CYPRESS_testPassword: ********************
CYPRESS_baseUrl: *********************
CYPRESS_CACHE_FOLDER: ~/.cache/Cypress
CYPRESS_testUsername: *******************************************
CYPRESS_RECORD_KEY: <redacted>
Application Data: /home/circleci/.config/cypress/cy/development
Browser Profiles: /home/circleci/.config/cypress/cy/development/browsers
Binary Caches: /home/circleci/.cache/Cypress
Cypress Version: 6.8.0
System Platform: linux (Ubuntu - 20.04)
System Memory: 33.7 GB free 11.3 GB
run cypress
error, here is the cypress output:
Cypress could not verify that this server is running:
> *********************
We are verifying this server because it has been configured as your `baseUrl`.
Cypress automatically waits until your server is accessible before running tests.
We will try connecting to it 3 more times...
We will try connecting to it 2 more times...
We will try connecting to it 1 more time...
Cypress failed to verify that your server is running.
Please start this server and then run Cypress again.
Exited with code exit status 1有没有办法解开柏树的输出?我搜索了Cypress文档,做了网络搜索,结果发现很短。
发布于 2021-08-10 22:25:27
好的,灯泡打开了,这样我就可以回答自己的问题了。
的线索
一旦我删除了环境变量,它就开始工作了。
https://stackoverflow.com/questions/68731812
复制相似问题