如何在詹金斯发布测试结果报告?

时间:2013-04-15 05:50:00

标签: c++ jenkins googletest

我想通过xunit插件发布jenkins中通过google cpp测试工具生成的xml格式的测试报告。在配置插件时我们必须指定模式。任何人都可以帮助在这种模式下写什么,因为如果我配置任何它会给出这个错误

**

[xUnit] [INFO] - [JUnit] - No test report file(s) were found with the pattern 'C:\Users\20040922\.jenkins\workspace\firstreport.xml' relative to 'C:\Users\20040922\.jenkins\jobs\jessy\workspace' for the testing framework 'JUnit'.  Did you enter a pattern relative to the correct directory?  Did you generate the result report(s) for 'JUnit'?
[xUnit] [ERROR] - No test reports found for the metric 'JUnit' with the resolved pattern 'C:\Users\20040922\.jenkins\workspace\firstreport.xml'. Configuration error?.
[xUnit] [INFO] - Setting the build status to FAILURE
[xUnit] [INFO] - Stopping recording.
Build step 'Publish xUnit test result report' changed build result to FAILURE
Finished: FAILURE

**

2 个答案:

答案 0 :(得分:4)

配置非java工具我们必须使用xunit插件。在Pattern中我们可以指定 * * / * .xml,它将搜索当前作业的工作区文件夹中的文件。

答案 1 :(得分:1)

我正在使用谷歌测试和JUnit测试结果报告。

要发布它的报告,需要更新已发布的* .xml文件的修改日期。下面的代码是我的工作方式,它适用于Windows Server

    GOOGLE_TEST.exe --gtest_output=xml 
    copy /b test_detail.xml+,,

在Linux或Mac中,您可能需要执行touch test_detail.xml而不是copy /b test_detail.xml(我没试过)

相关问题