xml – Jenkins:度量“JUnit”的结果文件无效.结果文件已被跳过

当Jenkins尝试通过Junit读取结果xml文件时,我收到此错误

这是输出

> [xUnit] [INFO] - Starting to record.
[xUnit] [INFO] - Processing JUnit
[xUnit] [INFO] - [JUnit] - 1 test report file(s) were found with the pattern '**\testResults\*.xml' relative to 'C:\Jenkins\jobs\InstantMatcher\workspace' for the testing framework 'JUnit'.
[xUnit] [ERROR] - The result file 'C:\Jenkins\jobs\InstantMatcher\workspace\Code\RegressionTest\testResults\result-InstantMatcher - copy.xml' for the metric 'JUnit' is not valid. The result file has been skipped.
[xUnit] [INFO] - Fail BUILD because 'set build Failed if errors' option is activated.
[xUnit] [INFO] - There are errors when processing test results.
[xUnit] [INFO] - Skipping tests recording.
[xUnit] [INFO] - Stop build.
Finished: FAILURE

我的XML文件看起来像这样

<testsuite failures="0" tests="209" name="UnitTests.MainClasstest">
    <testcase classname="UnitTests.OSUtils" name="stripExtension" parameters="" assertions="pass" time="0.03 ms"/>
        <testcase classname="UnitTests.OSUtils" name="changeExtension" parameters="" assertions="pass" time="0.04 ms"/>
        <testcase classname="UnitTests.OSUtils" name="stripPathAndExtension" parameters="" assertions="pass" time="0.04 ms"/>
        <testcase classname="UnitTests.OSUtils" name="getFilename" parameters="" assertions="pass" time="0.03 ms"/>
        <testcase classname="UnitTests.OSUtils" name="atoi" parameters="" assertions="pass" time="0.47 ms"/>
        <testcase classname="UnitTests.CImage" name="jpg matches bmp" parameters="" assertions="pass" time="N/A"/>
        <testcase classname="UnitTests.InstantMatcher" name="Bandpass Sync: " parameters="" assertions="pass" time="109.73 ms"/>
        <testcase classname="UnitTests.InstantMatcher" name="Orientation Dominance Sync: " parameters="" assertions="pass" time="109.73 ms"/>
        <testcase classname="UnitTests.InstantMatcher" name="Test Saliency MapSync: " parameters="" assertions="pass" time="109.73 ms"/>
        <testcase classname="UnitTests.InstantMatcher" name="Test Level Keypoints Sync: " parameters="" assertions="pass" time="109.73 ms"/>
        <testcase classname="UnitTests.InstantMatcher" name="Bandpass Sync: " parameters="" assertions="pass" time="109.73 ms"/>
        <testcase classname="UnitTests.InstantMatcher" name="Orientation Dominance Sync: " parameters="" assertions="pass" time="109.73 ms"/>
        <testcase classname="UnitTests.InstantMatcher" name="Test Saliency MapSync: " parameters="" assertions="pass" time="109.73 ms"/>
        <testcase classname="UnitTests.InstantMatcher" name="Test Level Keypoints Sync: " parameters="" assertions="pass" time="109.73 ms"/>
        <testcase classname="UnitTests.InstantMatcher" name="Bandpass Sync: " parameters="" assertions="pass" time="109.73 ms"/>
        <testcase classname="UnitTests.InstantMatcher" name="Orientation Dominance Sync: " parameters="" assertions="pass" time="109.73 ms"/>
        <testcase classname="UnitTests.InstantMatcher" name="Test Saliency MapSync: " parameters="" assertions="pass" time="109.73 ms"/>
        <testcase classname="UnitTests.InstantMatcher" name="Test Level Keypoints Sync: " parameters="" assertions="pass" time="109.73 ms"/>
        <testcase classname="UnitTests.InstantMatcher" name="Bandpass Sync: " parameters="" assertions="pass" time="109.73 ms"/>

有什么好主意吗?

Jenkins bug跟踪器中有许多关于xUnit解析失败的错误,它们具有各种类似JUnit的输出.如果你使用它理解的格式之一,xUnit很棒,但它不太适合解析非JUnit工具生成的类似JUnit的通用输出.根据我的经验,您最好使用内置的Publish JUnit测试结果报告构建后操作.

JENKINS-18095一个指向XSD的指针,xUnit用它来验证JUnit XML.基于此,我猜测你的testcase元素中的parameters属性正在绊倒xUnit验证.

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


php输出xml格式字符串
J2ME Mobile 3D入门教程系列文章之一
XML轻松学习手册
XML入门的常见问题(一)
XML入门的常见问题(三)
XML轻松学习手册(2)XML概念
xml文件介绍及使用
xml编程(一)-xml语法
XML文件结构和基本语法
第2章 包装类
XML入门的常见问题(二)
Java对象的强、软、弱和虚引用
JS解析XML文件和XML字符串详解
java中枚举的详细使用介绍
了解Xml格式
XML入门的常见问题(四)
深入SQLite多线程的使用总结详解
PlayFramework完整实现一个APP(一)
XML和YAML的使用方法
XML轻松学习总节篇