YSlow Phantomjs和Jenkins工作失败,但分析成功

时间:2014-04-04 14:20:03

标签: jenkins phantomjs yslow

我正在浏览Jenkins的YSlow和Phantom js教程:http://yslow.org/phantomjs/

除了Jenkins构建失败之外,一切看起来都很有效。我认为这是由于YSlow发现的违规行为(我正在测量的特定网站为6)。我宁愿让构建成功(或不稳定)而不是失败但

这是可能的,还是我必须使用postgroovy或text finder插件?

这是控制台输出:

phantomjs.exe yslow.js -i grade -t 50 --format junit http://www.somesite.com 1>yslow.xml 
D:\Apps\Jenkins\workspace\YSlow_Test>exit 6 
Build step 'Execute Windows batch command' marked build as failure

由于

1 个答案:

答案 0 :(得分:2)

执行Windows批处理命令构建步骤的 end 处的任何非零退出代码都将导致构建步骤标记为failure

要将构建步骤标记为success,您需要退出代码0。我不知道" yslow"或者" phantomjs"以及为什么他们给你的退出代码为非零,但来自"批次"另外,如果要覆盖exit 0命令的退出代码,则只需在构建步骤结束时编写phantomjs

然后,您可以使用 Text Finder plugin 来解析控制台日志,并在满足特定条件时将构建标记为unstable

阅读此回答, Configuring yslow on Jenkins 看起来您需要TAP plugin才能让单元测试功能将构建标记为自动不稳定