如何在詹金斯中保持单元测试输出 [英] How to keep the unit test output in Jenkins

查看:359
本文介绍了如何在詹金斯中保持单元测试输出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们已经设法让Jenkins从测试中正确解析我们的XML输出,并且在存在错误信息时也包含了错误信息.这样就可以直接在Jenkins的TestCase中看到发生的错误.

We have managed to have Jenkins correctly parse our XML output from our tests and also included the error information, when there is one. So that it is possible to see, directly in the TestCase in Jenkins the error that occurred.

我们想要做的是让Jenkins保留与每种情况相关的日志输出,该日志输出基本上是控制台输出.这样,任何人都可以查看每个测试用例的实际控制台输出,无论是否失败.

What we would like to do is to have Jenkins keep a log output, which is basically the console output, associated with each case. This would enable anyone to see the actual console output of each test case, failed or not.

我还没有办法做到这一点.

I haven't seen a way to do this.

*编辑*

说明-我希望能够直接在Jenkins界面中看到实际的测试输出,就像发生错误时的处理方式一样,但对于整个输出而言.我只希望詹金斯(Jenkins)将文件保留为工件.

Clarification - I want to be able to see the actual test output directly in the Jenkins interface, the same way it does when there is an error, but for the whole output. I don't want only Jenkins to keep the file as artifact.

*编辑结束*

有人可以帮助我们吗?

推荐答案

发布JUnit测试结果报告(构建后操作)中,选中Retain long standard output/error复选框.

In the Publish JUnit test result report (Post-build Actions) tick the Retain long standard output/error checkbox.

如果选中,则来自测试套件的任何标准输出或错误都将被 在构建完成后保留在测试结果中. (这是指 仅用于打印到控制台的其他消息,而不用于故障堆栈 如果测试失败,则始终保留此类输出,但默认情况下 通过测试的冗长输出会被截断以节省空间.查看 如果您需要查看甚至通过的每条日志消息,则使用此选项 测试,但请注意,詹金斯的内存消耗可能会大大降低 结果就增加了,即使您从不看测试结果!

If checked, any standard output or error from a test suite will be retained in the test results after the build completes. (This refers only to additional messages printed to console, not to a failure stack trace.) Such output is always kept if the test failed, but by default lengthy output from passing tests is truncated to save space. Check this option if you need to see every log message from even passing tests, but beware that Jenkins's memory consumption can substantially increase as a result, even if you never look at the test results!

这篇关于如何在詹金斯中保持单元测试输出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆