2015-04-06 50 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

相关问题