【问题标题】:dunit test result messages in hudson哈德逊的 dunit 测试结果消息
【发布时间】:2010-12-20 09:09:17
【问题描述】:

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

Stacktrace

MESSAGE:

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

在“发布测试工具结果报告”的 hudson 项目配置中,我选择“NUnit-Version N/A (default)”作为测试工具,因为列表中没有 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++ 项目上,所有消息都很好地报告了失败。

【问题讨论】:

标签: delphi hudson hudson-plugins dunit jenkins


【解决方案1】:

我不得不更改 XMLListener 以使其与 hudson 一起工作,因为失败的 XML 结构必须如下所示:

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

【讨论】:

  • 感谢您的(迟到的)回答。同时我写了一个junitListener。但你对这个错误是正确的。
  • 您能否更详细地解释您必须更改哪些内容才能使输出看起来像这样。我目前遇到了完全相同的问题。如果你能帮助我,我会很高兴的。
  • 非常感谢在这个问题上获得一些帮助。需要更改哪些内容才能收到上述正确的输出。
  • 我也是!我也想知道将 DUnit 与 hudson/jenkins 一起使用需要做些什么
  • 一些隐藏的假设。为 jenkings 安装 xUnit 测试插件。然后将 xUnit 配置为以答案中的自定义格式处理。
【解决方案2】:

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2023-04-04
    • 2011-11-27
    • 2010-12-04
    • 2011-05-24
    • 1970-01-01
    • 1970-01-01
    • 2012-02-11
    相关资源
    最近更新 更多