2013-04-15 118 views
2

我想通過xunit插件發佈通過google cpp測試工具在jenkins中生成的xml格式的測試報告。在配置插件,我們必須指定pattern.Can有人請幫助如何在這種模式寫,因爲如果我配置任何它給這個錯誤如何在詹金斯發佈測試結果報告?

**

[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 

**

+0

你有沒有嘗試過自己什麼?目前這看起來像一個「爲我做」的問題,這不適合Stackoverflow的問題指南 – Bojangles

+3

@Bojangles如果我沒有嘗試過,那麼我將如何知道我上面提到的錯誤?請通過問題並然後評論。 –

+1

請參閱http://stackoverflow.com/questions/15943091/boost-unit-tests-with-xunit-plugin-in-jenkins-do-not-work/15946832#15946832 – mark

回答

4

配置非我們必須使用xunit插件。在模式中,我們可以指定* */*。xml,它將搜索當前作業的工作區文件夾中的文件。

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(我沒有嘗試這個)