How might I integrate phpunit with Hudson CI?

We are looking at switching from phpundercontrol to Hudson (it looks to have some really cool features!) but I can't figure out how to get phpunit logs to show up.

I have phpunit running fine in Hudson with ant, and --log-xml is putting a phpunit.xml in the appropriate builds/ folder for that build. But I can't figure out how to get that to show up for the build, so that we can see the tests the ran and which failed, if any.

After I figure that out, getting coverage, metrics, and api will be next :)

It seems like it should be trivial for anything which generates its on HTML, to tell Hudson for example "For this project show a link to 'API' for each build and link to builds/$BUILDNUM/api/index.html".


I installed the xUnit plugin, pointed it at my log file (from job config), and it works like a charm. It appears there is no longer a need for any custom hacks.

http://wiki.hudson-ci.org/display/HUDSON/xUnit+Plugin


With the last answer being from 2009 and a lot of people migrating from Hudson to Jenkins now due to Oracle, consider using the Jenkins Template for PHP , offering a free and convenient template for all your configuration needs of PHPQATools, like pdepend, phpmd, phpcs and phpunit in one convenient template.

  • http://jenkins-php.org/
  • http://edorian.posterous.com/setting-up-jenkins-for-php-projects
  • There is also the IRC channel #jenkins-php on Freenode for support.


    你也可以使用这个xslt文件将phpunit xml转换成hudson / junit xml:

    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:template match="/">
        <xsl:element name="testsuites">
            <xsl:for-each select="//testsuite[@file]">
                 <xsl:copy-of select="." />
            </xsl:for-each>
        </xsl:element>
    </xsl:template>
    </xsl:stylesheet>
    
    链接地址: http://www.djcxy.com/p/50740.html

    上一篇: 整合哈德森与MS测试?

    下一篇: 我该如何整合phpunit和Hudson CI?