带有Jenkins的xUnit:如何在构建控制台输出中显示颜色? [英] xUnit with Jenkins: how to display colors in the Build Console Output?

查看:162
本文介绍了带有Jenkins的xUnit:如何在构建控制台输出中显示颜色?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我成功设置了CasperJS测试套件,以这种方式导出到xUnit XML文件:

I successfully setup CasperJS test suite exporting to an xUnit XML file that way:

$ casperjs test googletesting.js --xunit=log.xml

由于 xUnit插件

我什至借助[Mail Watcher Plugin] [3]设法在构建失败时设置了电子邮件通知,这太好了!

I even managed to setup emails notifications when a build fails thanks to [Mail Watcher Plugin][3] which is great !

唯一的问题是输出的格式,这是一个有点混乱。
在构建控制台输出和电子邮件通知中,我看到以下内容:

The only problem is the format of the output, it's a bit messy. In the build console output and in my email notifications I see the following:

[37;46;1mTest file: tests.js[0m
[33m# TEST XXX[0m
[32;1mPASS[0m #aaa found
[32;1mPASS[0m #bbb found
[32;1mPASS[0m ccc found
[32;1mPASS[0m ddd found

href = https://wiki.jenkins-ci.org/display/JENKINS/Mail+Watcher+Plugin rel = nofollow> xUnit插件页,它显示:

In the xUnit Plugin page, it says:


对于每个xUnit工具,都使用嵌入式样式表。但是,该插件还使您能够为自己的工具(例如WebUI)使用自定义样式表

For each xUnit tool, an embedded style sheet is used. However, the plugin also enables you to use a custom style sheet for your own tool such as WebUI

是否可以显示构建输出,以便使用漂亮的颜色正确设置样式?

Is there a way to display the build output so that it's styled properly with beautiful colors ?

推荐答案

万岁!

实际上,描述我的问题让我进行调查并找到解决方案!

Actually, describing my problem made me investigate and find a solution !

我只需要安装 AnsiColor插件,然后从构建环境中选中颜色ANSI控制台输出框!

I just needed to install the AnsiColor Plugin and check the Color ANSI Console Output box from the Build Environment !

此处提供更多信息: http://code.dblock.org/the-jenkins-ansicolor-plugin-youve-all-been-waiting-for

它现在在控制台输出中显示漂亮的颜色。

It now displays beautiful colors in my Console Output.

我的电子邮件通知中仍然很烂,但是谁在乎呢?...

Still shitty in my email notifications but who cares ?...

希望它可以帮助您!

这篇关于带有Jenkins的xUnit:如何在构建控制台输出中显示颜色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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