Azure DevOps中“以代码1退出bash”中的Cypress测试出口失败 [英] Failed Cypress test exit in 'bash exited with code 1' in Azure DevOps

查看:105
本文介绍了Azure DevOps中“以代码1退出bash”中的Cypress测试出口失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经设置了赛普拉斯测试以在Azure DevOps中运行。我通过yml文件中的CMD命令运行测试,然后获取测试结果。测试通过后,一切都会按预期进行,测试结果将显示在摘要中。如果测试失败,则CMD步骤将失败,并返回错误## [error] Bash,并返回代码 1,并且不会填充测试结果。有没有办法在失败的测试中以0退出bash?

I have setup my Cypress tests to run in Azure DevOps. I run the test via CMD command in my yml file and then get the test results. When the tests pass everything is working as expected and the test results show up in the summary. When the a test fails the CMD steps fails with the error ##[error]Bash exited with code '1' and the test results are not populated. Is there a way the bash exit with 0 on failed tests as well?

推荐答案

您可以要求bash忽略这样的错误

You can ask bash to ignore the error like this

my-test-script || true

请参阅答案重击忽略特定命令的错误

这篇关于Azure DevOps中“以代码1退出bash”中的Cypress测试出口失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆