当鼻子测试失败时,詹金斯失败了

时间:2015-06-17 01:32:14

标签: python shell jenkins continuous-integration

我正在通过Jenkins管理Flask应用的部署/ CI。我有一个执行shell形式的构建步骤,它在主机中运行一个shell脚本,然后运行nosetests。

Jenkins shell命令如下所示:

$WORKSPACE/ops/test_integration.sh

integration.sh看起来像这样:

SETTINGS_FILE="settings/integration.py" nosetests $@

如果上面的shell脚本中的nosetests失败,我如何让jenkins作业失败并停止构建?感谢。

1 个答案:

答案 0 :(得分:2)

我怀疑鼻子测试会在失败时返回非零值

因此您可以使用

将shell设置为自动失败
set -e

here

中的任何其他选项