哈德逊的 dunit 测试结果消息

发布于 2024-10-08 10:04:03 字数 1054 浏览 0 评论 0原文

我正在使用 Hudson 作为 Delphi 2010 项目的 CI 服务器。 XMLTestRunner.pas 单元将 DUnit 测试结果写入 xml 文件,hudson xUnit 插件使用该文件来报告测试结果。 xUnit 插件显示失败,但没有消息:

Stacktrace

MESSAGE:

+++++++++++++++++++
STACK TRACE:

在“发布测试工具结果报告”的 hudson 项目配置中,我选择“NUnit-Version N/A(默认)”作为测试工具,因为列表中没有 dunit 选项,并且xml 文件看起来类似于 nunit 格式:

<?xml version="1.0" encoding="ISO-8859-1" standalone="yes" ?>
<test-results total="123" notrun="0" date="20.12.2010" time="09:19:24">
<test-suite name="HelloWorldTestSuite" total="46" notrun="0">
<results>
<test-case name="TestCase.HelloWorldTest" execute="True" success="False" time="0,003" result="Failure">
<failure name="ETestFailure" location=""/>
<message>expected: &lt; hello world! &gt; but was: &lt; hallo welt &gt;</message>
</test-case>
...

在 hudson 配置中还有一个“自定义工具”选项,我必须在其中指定“自定义样式表”,但我不知道如何编写这样的样式表(是否有任何文档?)。

在我进行 boost 测试的 C++ 项目上,所有消息都很好地报告了故障。

i am using Hudson as CI server for Delphi 2010 projects. The XMLTestRunner.pas unit writes DUnit test result to a xml file that is used by the hudson xUnit plugin to report test results. The xUnit plugin shows failures but no messages:

Stacktrace

MESSAGE:

+++++++++++++++++++
STACK TRACE:

In the hudson project configuration at "Publish testing tools result report" i choose "NUnit-Version N/A (default)" as tesing tool, because there is no dunit option in the list and the xml files looks similar to nunit format:

<?xml version="1.0" encoding="ISO-8859-1" standalone="yes" ?>
<test-results total="123" notrun="0" date="20.12.2010" time="09:19:24">
<test-suite name="HelloWorldTestSuite" total="46" notrun="0">
<results>
<test-case name="TestCase.HelloWorldTest" execute="True" success="False" time="0,003" result="Failure">
<failure name="ETestFailure" location=""/>
<message>expected: < hello world! > but was: < hallo welt ></message>
</test-case>
...

In the hudson configuration there is also an "Custom Tool" option, where i have to specify a "Custom stylesheet", but i don't know how to write such a stylesheet (is there any documentation?).

On my C++ projets with boost test, the failures are reported nicely with all messages.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

蓝礼 2024-10-15 10:04:03

我必须更改 XMLListener 才能使其与 hudson 一起工作,因为故障的 XML 结构必须如下所示:

<testcase name="GetFreeDirNameTest" classname="Test.exe.MyFiles.TTests" result="failed" time="0.000">
  <failure message="Expected:
        "-1"
        But was:
        "0"" type="failed">GetFreeDirNameTest: Expected:
        "-1"
        But was:
        "0"
  </failure>
</testcase>

I had to change the XMLListener to get it work with hudson because the XML structure of a failure had to look like this:

<testcase name="GetFreeDirNameTest" classname="Test.exe.MyFiles.TTests" result="failed" time="0.000">
  <failure message="Expected:
        "-1"
        But was:
        "0"" type="failed">GetFreeDirNameTest: Expected:
        "-1"
        But was:
        "0"
  </failure>
</testcase>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文