2009-10-07 74 views
1

我使用Hudson作爲CI服務器來構建幾個不同的.net 3.5項目。實際構建的東西效果很好。Hudson的工作與加利奧測試報告「沒有測試」

不過,我運行使用Gallio.Echo作爲構建的一部分MbUnit的V2測試,而測試似乎運行正常,哈德森稱,沒有測試運行。

我有以下生成步驟之後的 「建設使用的MSBuild一個Visual Studio項目或解決方案」 的步驟:

類型:執行Windows批處理命令 命令:

「C:\ Program Files文件\ Gallio \ bin \ Gallio.Echo.exe「TestLibrary \ bin \ Release \ TestLibrary.dll/rt:Xml/rnf:mbunit-result/rd :. 退出0

當構建運行,這給在控制檯日誌輸出如下:

Gallio Echo - Version 3.1 build 313 
Get the latest version at http://www.gallio.org/ 

Start time: 09:06 
Initializing the runtime and loading plugins. 
Verifying test files. 
Initializing the test runner. 
Running the tests. 
[ignored] Test TestLibrary/ConfigTests/LoadAndSaveTest 

Generating reports. 
Disposing the test runner. 
Stop time: 09:07 (Total execution time: 10,210 seconds) 

64 run, 64 passed, 0 failed, 0 inconclusive, 1 skipped (1 ignored) 

所以在我心中毫無疑問的是,實際測試運行 - 和MbUnit的-結果。 XML文件是在正確的地方,看起來不錯。

我也配置了項目「發佈加利奧測試結果報告」,只是指定的「檢測報告個XML」值「MbUnit的,爲result.xml」。

爲了解決這個問題,我配置了Gallio插件(通過作業的config.xml文件),使jUnit文件(即Gallio插件從MbUnit測試結果創建的)保留在原地,然後我拿了一個查看junitResult.xml文件 - 奇怪的是每個套件的每個「cases」元素都是空的。即一個套件可以看起來像這樣:

<suite> 
    <file>C:\Documents and Settings\Administrator\.hudson\jobs\TestProject\workspace\temporary-junit-reports\TEST-TestLibrary.Encryption_Tests.xml</file> 
    <name>TestLibrary.Encryption_Tests</name> 
    <duration>0.0</duration> 
    <cases/> 
</suite> 

據我所知,該部分是單個單元測試應該駐留的地方。此外,持續時間不應該是0.0。

正如你在上面看到的,我的Gallio版本是3.1版本313.這可能是由於這個Gallio版本的報告格式的改變(只是一個猜測,我不知道任何這樣的改變)?

我哈德森v1.323運行,同時公堂插件v0.52。任何有關如何讓哈德森看到測試結果的見解將不勝感激!

回答

2

是的,這是由於加利奧3.1的XML格式改變。 這裏看看,在這裏我提出了一個測試文件來解決這一問題....

http://code.google.com/p/mb-unit/issues/detail?id=399

+0

嗨菲利普, 這解決了我的問題,因爲我也在谷歌代碼鏈接(或試圖)報告。非常感謝,無論是通用插件還是此修補程序! – 2009-11-04 08:09:04

0

mbunit-result.xml在工作區的根源在哪裏?您可以使用工作區瀏覽器進行檢查。如果它不在工作區的根部,我會建議在Gallio插件配置中指定路徑。

+0

這的確是在工作區的根。我不得不指定命令行選項「/ rd :.」爲了做到這一點,所以我徹底檢查了它。 :) – 2009-10-07 17:02:34