首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >jenkins不接受casperjs的xunit xml日志

jenkins不接受casperjs的xunit xml日志
EN

Stack Overflow用户
提问于 2013-08-20 14:10:23
回答 1查看 2.6K关注 0票数 2

我在我的詹金斯服务器上工作。这个测试是可以执行的,而且是成功的。但问题是:

Casperjs将其结果记录在log.xml文件中。我想我可以在我的jenkins webUI上显示这个xml文件的内容。我发现了jenkins的xunit插件,但它不像预期的那样工作:

[37;42;1 1mPASS 12测试在22.324 s中执行,12次通过,0失败,0可疑,0被跳过。[0m ]

如您所见,测试是成功的。

[32;1mResult日志存储在./../build/前端测试/log.xml中 [0m出版三叶草报道.发布三叶草XML报告。发布三叶草覆盖结果..。记录测试结果xUnit -开始记录。xUnit - Processing 3.x(默认) xUnit - AUnit-3.x (默认)-1测试报告文件与测试框架'AUnit-3.x (默认)‘的模式’构建/前端测试/log.xml‘相关。xUnit -度量'AUnit‘的结果文件无效。结果文件已被跳过。xUnit -失败生成,因为‘设置生成失败,如果错误’选项被激活。

Jenkins构建失败,因为我的log.xml不适用于AUnit。我还试过JUnit和JSUnit。同样的结果。但我不明白。casperjs导出xunit xml文件,我安装了xunit插件。但是这个插件不读我的log.xml。

你有什么解决办法吗?也许我的詹金斯设置错了?有什么想法吗?

谢谢..。

这是我的log.xml

代码语言:javascript
复制
<?xml version="1.0" encoding="UTF-8"?>   <testsuites duration="3.859">
    <testsuite name="Checking the portal search for http://www.xxx.de/suche/jeans" tests="1" failures="0" errors="0" time="2.687" timestamp="2013-08-20T14:12:55.953Z" package="./execute_search_tests">
      <testcase name="Subject equals the expected value" classname="./execute_search_tests" time="2.687"></testcase>
      <system-out></system-out>
    </testsuite>
    <testsuite name="Checking the portal search for http://www.xxx.de/suche/asjdfkshjkfhdsjkafhkjasd" tests="1" failures="0" errors="0" time="1.172" timestamp="2013-08-20T14:12:55.954Z" package="./execute_search_tests">
      <testcase name="Subject equals the expected value" classname="./execute_search_tests" time="1.172"></testcase>
      <system-out></system-out>
    </testsuite>   </testsuites>
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-08-20 22:04:56

注意:您已经使用XUnit选项配置了您的AUnit post生成操作。这是给Ada单元测试的。

但是我也测试了XUnit插件和JUnit选项,但仍然失败了。我甚至启用更多日志,但这没有帮助。

代码语言:javascript
复制
Aug 21, 2013 12:00:05 AM com.thalesgroup.hudson.plugins.xunit.service.XUnitService errorSystemLogger
SEVERE: [xUnit] - The result file '/Users/lacostej/.jenkins/workspace/test-casperjs-xunit/log.xml' for the metric 'JUnit' is not valid. The result file has been skipped.
Aug 21, 2013 12:00:05 AM com.thalesgroup.hudson.plugins.xunit.service.XUnitService warningSystemLogger
WARNING: [xUnit] - The file '/Users/lacostej/.jenkins/workspace/test-casperjs-xunit/log.xml' is an invalid file.
Aug 21, 2013 12:00:05 AM com.thalesgroup.hudson.plugins.xunit.service.XUnitService infoSystemLogger
INFO: [xUnit] - [JUnit] - 1 test report file(s) were found with the pattern 'log.xml' relative to '/Users/lacostej/.jenkins/workspace/test-casperjs-xunit' for the testing framework 'JUnit'.

然而,当我使用"JUnit测试结果报告“进行一些测试时,插件和解析就没问题了。

更新

正如您所发现的,问题是使用casperjs文件,使用属性持续时间,而不是测试套件节点的时间。。Xunit比标准的junit更严格。

我的建议:

  1. 使用标准的JUnit解析,它可以工作。
  2. 如果您真的想使用xunit,就必须修复它,然后报告xunit解析中的一个bug。下面是我使用的测试用例配置:https://gist.github.com/lacostej/6287937
  3. 或者尝试与XSL一起使用自定义样式。您仍然需要调试并知道为什么您的XML不被接受。

我会选择第一或第二种选择。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/18337233

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档