当 nosetests 失败时,Jenkins 的工作失败

Fail Jenkins job when nosetests fail

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

Jenkins shell 命令如下所示:

$WORKSPACE/ops/test_integration.sh

integration.sh 看起来像这样:

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

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

我怀疑 nosetests 会 return 失败时的非零值

因此您可以将 shell 设置为自动失败

set -e

here

中的任何其他选项