Hudson - 仅在低于 90% 通过时保存工件
我对此很陌生,我想知道如何设置才能保存工件,前提是只有少于 90% 的测试通过了。
知道我该怎么做吗?
谢谢
I am new at this and I was wondering how I can setup that I save the artifacts, only if less than 90% of the tests have passed.
Any idea how I can do this?
thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
目前 Hudson 还无法做到这一点。避免在每个构建中归档工件的动机是什么?
This is not currently possible with Hudson. What is the motivation to avoid archiving artifacts on every build?
一个相当简单的解决方法怎么样?您创建一个后构建步骤(或附加构建步骤),从命令行调用您的测试。请务必捕获所有错误,以便 Hudson 不会将其视为失败。然后您评估您的情况并相应地设置错误级别。此外,您需要在设置错误级别之前保存报告(可能在 hudson 之外),这样即使或仅在构建失败时它们也可用。
我的假设是,在构建应用程序失败时不运行测试是可以的。但是,您可以将构建和测试分为两项工作。请参阅此处。
How about a rather simple workaround. You create a post build step (or additional build step) that calls your tests from the command line. Be sure to capture all errors so Hudson don't count it as a failure. Than you evaluate your condition and set the error level accordingly. In addition you need to save reports (probably outside hudson) before you set the error level, so they are available even or only when the build fails.
My assumption here is, that it is OK, not to run the tests when building the app fails. However, you can separate the building and testing in two jobs. See here.