Jenkins/Hudson 和 Gallio 单元测试集成

发布于 2024-10-19 05:16:22 字数 406 浏览 6 评论 0原文

我正在努力让它运行我的测试。在 Jenkins 上的执行 Windows 批处理命令中,我输入了以下命令:

C:\Program Files (x86)\Gallio\bin\Gallio.Echo.exe" /report-type:Html /verbosity:quiet “Project.Tests\bin\Release\*.Tests.dll

它不喜欢 *.Tests.dll 位,因为它说:

找不到包含文件模式 的目录Project.Tests\bin\Release\*.Tests.dll

我的下一个问题是,如果我将报告类型更改为 xml,是否可以直接在 hudson 中发布我的单元测试报告?

非常感谢。

I am struggling to get it to run my tests. In the Execute Windows batch command on Jenkins, I have put the following command:

C:\Program Files (x86)\Gallio\bin\Gallio.Echo.exe" /report-type:Html /verbosity:quiet “Project.Tests\bin\Release\*.Tests.dll

It doesn't like the *.Tests.dll bit, in that it says:

Cannot find directory containing file pattern Project.Tests\bin\Release\*.Tests.dll.

My next question would be if I change the report-type to xml, is it straight forward to get my unit test reports published in hudson?

many thanks.

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

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

发布评论

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

评论(3

你是暖光i 2024-10-26 05:16:22

以下摘录在 Windows Batch 命令构建步骤中运行 Gallio 测试 (从以下位置下载 Gallio)

"c:\Program Files\Gallio\bin\Gallio.Echo.exe" %WORKSPACE%\YourTestPro\bin\Debug\YourTestPro.dll /report-directory:%WORKSPACE%\TestResults /report-type:Xml /working-directory:%WORKSPACE%

设置 Jenkins报告生成

  1. 将 Gallio Jenkins 插件添加到 Jenkins 安装中以发布报告
  2. 在您的项目中,在“添加项目后操作”构建步骤下添加 xUnit 测试结果报告
  3. 选择 xUnit 操作步骤中显示的“添加”按钮
  4. 选择 Gallio - N/A
  5. TestResults/*.xml 添加到 Gallio N/A 模式

The following extract runs Gallio tests in a Windows Batch command build step (Download Gallio from)

"c:\Program Files\Gallio\bin\Gallio.Echo.exe" %WORKSPACE%\YourTestPro\bin\Debug\YourTestPro.dll /report-directory:%WORKSPACE%\TestResults /report-type:Xml /working-directory:%WORKSPACE%

To setup Jenkins report generation

  1. Add the Gallio Jenkins plugin to your Jenkins installation to publish the report
  2. In your project under the Add post project action build steps add the xUnit test result report
  3. Select the Add button that appears in the xUnit action step
  4. Select Gallio - N/A
  5. Add TestResults/*.xml to the Gallio N/A Pattern
情魔剑神 2024-10-26 05:16:22

您可以使用 .Net 的 Maven 插件: http://docs.codehaus.org/display /SONAR/.Net+插件
它负责 Gallio 命令行生成:您可以提供一个过滤器:

<visual.test.project.pattern>*.Tests</visual.test.project.pattern>
<gallio.filter>Category:UnitTests</gallio.filter>

然后,Maven 插件生成命令行。
使用 Maven 还具有很多优势:与 Partcover/NCover、stylecop/fxcop/gendarme 等集成。

或者您可以为此制作一个 MSBuild 脚本:

<itemGroup>
    <TestsDll Include="**\bin\$(Configuration)\*.Tests.dll" />
</itemGroup>
<Exec Command="Gallio.Echo.exe @(TestsDll, ' ')"/>

You can use Maven plugin for .Net: http://docs.codehaus.org/display/SONAR/.Net+plugin
It takes care of Gallio command line generation: you can provide a filter :

<visual.test.project.pattern>*.Tests</visual.test.project.pattern>
<gallio.filter>Category:UnitTests</gallio.filter>

Then, the Maven plugin generates the command line.
You also have a lot of advantages using maven: integration with Partcover/NCover, stylecop/fxcop/gendarme, etc.

OR you can make a MSBuild script for that:

<itemGroup>
    <TestsDll Include="**\bin\$(Configuration)\*.Tests.dll" />
</itemGroup>
<Exec Command="Gallio.Echo.exe @(TestsDll, ' ')"/>
南风几经秋 2024-10-26 05:16:22

我很确定您想研究使用 Gallio 插件 而不是使用执行 Windows 批处理命令。

I am pretty sure you want to look into using the Gallio Plugin instead of using the execute windows batch command.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文