gpt4 book ai didi

testing - 为什么 Jenkins 不正确地解析我的 JUnit 报告?

转载 作者:行者123 更新时间:2023-11-28 20:41:54 24 4
gpt4 key购买 nike

我有一个 Jenkins 作业,每次我将代码推送到我的存储库时它都会运行。这项工作的最后一步是运行一系列 behat测试。这些测试同时输出“漂亮”格式化程序和 jUnit 格式化程序。 jUnit XML 如下所示:

<?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

这是没有意义的,甚至不包括我的测试用例。给了什么?

最佳答案

进一步查看,问题出在上次测试结果中包含的句点(.)字符!我刚刚删除了句点,一切正常!

enter image description here enter image description here

关于testing - 为什么 Jenkins 不正确地解析我的 JUnit 报告?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29471614/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com