我正在Jenkins运行带有nosetests的测试用例.一般来说,它将有100个测试用例,我想在少于20个测试用例失败时标记构建不稳定.如果超过20个测试用例失败,则标记构建失败.
我跑的命令:
nosetests test.py --tc-file config.yml --tc-format yaml
Run Code Online (Sandbox Code Playgroud)
首先,我试图将构建的状态更改为Unstable但它仍然失败.
我使用的groovy脚本:
manager.addWarningBadge("Thou shalt not use deprecated methods.")
manager.createSummary("warning.gif").appendText("<h1>You have been warned!</h1>", false, false, false, "red")
manager.buildUnstable()
Run Code Online (Sandbox Code Playgroud)
执行前两行代码,但作业仍标记为失败.
我的jenkins配置有什么问题吗?或者groovy postbuild插件不适用于nosetest?
这是控制台输出:
FAILED (failures=2)
Build step 'Execute shell' marked build as failure
Build step 'Groovy Postbuild' marked build as failure
Finished: FAILURE
Run Code Online (Sandbox Code Playgroud)