2015-04-06 99 views
1

我有一個Jenkins作業,每次將代碼推送到我的存儲庫時都會運行。這項工作的最後一步是運行一系列behat測試。這些測試輸出「漂亮」格式化程序和jUnit格式化程序。 jUnit XML看起來如下:爲什麼Jenkins不正確地解析我的JUnit報告?

<?xml version="1.0" encoding="UTF-8"?> 
<testsuites name="default"> 
    <testsuite name="Confirm that the theme is enabled" tests="1" skipped="0" failures="0" errors="0"> 
    <testcase name="Make sure all drupal regions are present on the homepage" status="passed"></testcase> 
    </testsuite> 
    <testsuite name="Confirm that Drupal installed" tests="2" skipped="0" failures="0" errors="0"> 
    <testcase name="Look for a body element on the homepage" status="passed"></testcase> 
    <testcase name="Make sure users can login" status="passed"></testcase> 
    </testsuite> 
    <testsuite name="Validate API" tests="2" skipped="0" failures="0" errors="0"> 
    <testcase name="Show that service is available at /api/v1." status="passed"></testcase> 
    <testcase name="Make sure the the api/v1/page_wrapper response is valid" status="passed"></testcase> 
    </testsuite> 
    <testsuite name="Confirm main menu has installed properly." tests="1" skipped="0" failures="0" errors="0"> 
    <testcase name="Confirm the main menu links are present." status="passed"></testcase> 
    </testsuite> 
</testsuites> 

到目前爲止這麼好。問題是最後一個測試,「確認主菜單已正確安裝。」這是最近添加的,它從來沒有像其他人一樣行事。它是唯一一個在測試結果概覽頁面上顯示爲根元素的兄弟。這就是說,當我點擊「測試結果」我看到這一點:

enter image description here

當我點擊(root)我看到我所有的其他測試結果。但是,當我點擊「確認主菜單已經正確安裝了」我看到這一點:

A picture of Jenkins failing to display my test cases

這是毫無意義的,甚至不包括我的測試用例。是什麼賦予了?

回答

0

經過進一步的審查,問題是包含在最後的測試結果中的時間段(.)!我剛剛刪除了這段時間,一切正常!

enter image description here enter image description here