简体   繁体   English

詹金斯没有在覆盖范围内失败的测试中失败

[英]Jenkins not failing on tests that fail in coverage

I have Jenkins setup to run tests before anything gets pushed into our QA environment. 我有Jenkins设置在任何被推入QA环境之前运行测试。 Recently I added python coverage to check code coverage of the tests. 最近我添加了python覆盖来检查测试的代码覆盖率。

Issue I have is not I see in the output that tests are failing, but the build still pushes through. 问题我没有在输出中看到测试失败,但构建仍然推进。

I am running the following in a bash script: 我在bash脚本中运行以下代码:

coverage run manage.py test --settings=my.settings.jenkins --noinput

When I was running the tests normally without coverage, if the test failed, the build would fail, this is no longer the case. 当我正常运行测试时没有覆盖,如果测试失败,构建将失败,这不再是这种情况。

The project is a Django project on Python 3, any help would greatly be appreciated. 该项目是Python 3上的Django项目,非常感谢任何帮助。

I am hitting the same issue. 我遇到了同样的问题。 My Jenkins build always passes even if Coverage.py has some failing tests (I use the same command as you). 即使Coverage.py有一些失败的测试(我使用与你相同的命令),我的Jenkins构建也总是通过。

I have come up with a workaround but would ideally like to know if you figured it out? 我想出了一个解决方法,但理想情况下想知道你是否想出来了?

My workaround uses the TextFinder plugin and I search the console for a specific string which I then fail the build if found....Hack-y I know! 我的解决方法使用TextFinder插件,我在控制台中搜索一个特定的字符串,如果找到,我就失败了.Hack-y我知道!

https://wiki.jenkins-ci.org/display/JENKINS/Text-finder+Plugin https://wiki.jenkins-ci.org/display/JENKINS/Text-finder+Plugin

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

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