首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >柏树测试套件有办法在其输出中公开敏感信息以供调试吗?

问柏树测试套件有办法在其输出中公开敏感信息以供调试吗?
EN

Stack Overflow用户
提问于 2021-08-10 18:20:19
回答 1查看 71关注 0票数 1

背景:我试图在圆环CI上运行Cypress (npx cypress run)。我使用了Cypress Orb,尽管我最近对它进行了扩展以添加更多的故障排除信息。我的设置相当复杂,有5个容器旋转,以提供测试环境。所以,我是在一个循环CI机器上运行的,而不是码头。

问题:使用Cypress测试来查看我的baseUrl是活动的,并发现它不是活着的,但是我可以通过使用curl语句来单独证明它是活着的。我所能想到的是,Cypress没有使用配置好的baseUrl,但是我不知道它是什么,因为它和其他敏感信息一起被屏蔽了。我尝试将-dev标志添加到柏树命令中,但仍然掩盖了这些信息。

下面是我的config.yml中“命令”的相关部分:

代码语言:javascript
复制
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上执行:

代码语言:javascript
复制
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文档,做了网络搜索,结果发现很短。

EN

回答 1

Stack Overflow用户

发布于 2021-08-10 22:25:27

好的,灯泡打开了,这样我就可以回答自己的问题了。

  1. Cypress没有掩盖输出,圆环CI就是这样做的。这是#2.

的线索

  1. 循环CI是为定义CYPRESS_baseUrl环境变量而建立的(而不是由我设置的)。它的值被Cypress用来覆盖cypress.json文件中的设置。而且,环境变量中的值是不正确的!

一旦我删除了环境变量,它就开始工作了。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/68731812

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档