Jenkins使用的PHPUnit报告模式在哪里? [英] Where is the PHPUnit report schema used by Jenkins?

查看:436
本文介绍了Jenkins使用的PHPUnit报告模式在哪里?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当测试中有异常时,我遇到了让Jenkins解析xunit.xml报告文件的问题。 XML看起来很好,所以我看不到任何问题。有一个xsd文件在某个地方,我可以比较我的xml,看看什么实际上导致该文件是不可解释的。

I am having problems getting Jenkins to parse a xunit.xml report file when there are exceptions in the tests. The XML looks well-formed so I can't see any problem just by looking at it. Is there a xsd file somewhere that I can compare my xml against to see what actually causing the file to be unparsable?

关于我的设置:
我设置在Jenkins的一个每夜工作一个PHP项目。我们使用Cakephp 1.3因此我们仍然使用SimpleTest而不是PHPUnit。我唯一能够找出来使用simpletest轻松生成报告xml的方法是使用stagehand_testrunner(http://redmine.piece-framework.com/projects/stagehand-testrunner)。在我的构建脚本中,我做了类似:
cakerunner --cakephp-app-path = src / app --log- junit = build / test-results / junit.xml -R src / app / tests

About my setup: I set up a nightly job in Jenkins for a PHP project. We are using Cakephp 1.3 therefore we are still using SimpleTest instead of PHPUnit. The only way I could figure out to easily produce the report xml while using simpletest was to use stagehand_testrunner (http://redmine.piece-framework.com/projects/stagehand-testrunner). In my build script I did something like: cakerunner --cakephp-app-path=src/app --log- junit=build/test-results/junit.xml -R src/app/tests

这很好,但是如果测试中抛出异常,jenkins无法解析junit.xml。

This works great, however jenkins is unable to parse the junit.xml if there were exceptions thrown in the tests.

推荐答案

这是我的愚蠢。我相信stagehand-test runner已经以JUnit格式格式化了结果xml。我试图将一个JUnit xml报告从PHPUnit转换为JUnit。

This was silly of me. I believe that stagehand-test runner already formats the resulting xml in JUnit format. I was trying to convert a JUnit xml report from PHPUnit to JUnit.

在Jenkins中,我需要使用选项发布JUnit测试结果报告而不是发布测试工具结果报告后者是用于与其他测试框架转换为JUnit格式。由于我已经有一个JUnit格式的文件,我不需要转换它。

In Jenkins I needed to use the option "Publish JUnit test result report" instead of "Publish testing tools result report" The latter is for use with other testing frameworks to convert them to JUnit format. Since I already have a file in JUnit format, I do not need to convert it.

我需要验证这一点,但我相信是这样。

I need to verify this but I believe it to be the case.

当我们移动到CakePHP 2.0并使用PHPUnit时,我会很高兴。

I will be glad when we move to CakePHP 2.0 and use PHPUnit.

这篇关于Jenkins使用的PHPUnit报告模式在哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆