开发者

Display Fitnesse XML reports within Hudson GUI

After running fitnesse test using testrunner, I get an xml file containing all the results. Now I can't figure out how to display those resu开发者_如何转开发lts within the hudson GUI for a specific job.

I've surfed the web, and what I found is a couple people modifying the xsd file from CruiseControl.NET, but nobody is actually showing it working!

If someone could help me out or point me in the right direction, that would be greatly appreciated.

Thank You. Yohann


I transform the xml output by an xslt from fitnesse to junit format and publish the tests results. Unfortunately, I was not able to get the html result of a failure displayed inside hudson, however it is not a real problem since all I want to know is if my acceptance tests are ok.

Below is a copy of the xslt I use.

<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
  <xsl:element name="testsuite">
    <xsl:attribute name="tests">
      <xsl:value-of select="sum(testResults/finalCounts/*)" />
    </xsl:attribute>
    <xsl:attribute name="failures">
      <xsl:value-of select="testResults/finalCounts/wrong" />
    </xsl:attribute>
    <xsl:attribute name="disabled">
      <xsl:value-of select="testResults/finalCounts/ignores" />
    </xsl:attribute>
    <xsl:attribute name="errors">
      <xsl:value-of select="testResults/finalCounts/exceptions" />
    </xsl:attribute>
    <xsl:attribute name="name">AcceptanceTests</xsl:attribute>
  <xsl:for-each select="testResults/result">
    <xsl:element name="testcase">
      <xsl:attribute name="classname">
        <xsl:value-of select="/testResults/rootPath" />
      </xsl:attribute>
      <xsl:attribute name="name">
        <xsl:value-of select="relativePageName" />
      </xsl:attribute>
      <xsl:choose>
        <xsl:when test="counts/exceptions > 0">
          <xsl:element name="error">
            <xsl:attribute name="message">
              <xsl:value-of select="counts/exceptions" />
              <xsl:text> exceptions thrown</xsl:text>
              <xsl:if test="counts/wrong > 0">
                <xsl:text> and </xsl:text>
                <xsl:value-of select="counts/wrong" />
                <xsl:text> assertions failed</xsl:text>
              </xsl:if>
            </xsl:attribute>
          </xsl:element>
        </xsl:when>
        <xsl:when test="counts/wrong > 0">
          <xsl:element name="failure">
            <xsl:attribute name="message">
              <xsl:value-of select="counts/wrong" />
              <xsl:text> assertions failed</xsl:text>
            </xsl:attribute>
          </xsl:element>
        </xsl:when>
      </xsl:choose>
    </xsl:element>
  </xsl:for-each>
  </xsl:element>
</xsl:template>
</xsl:stylesheet>


There are some changes coming to FitNesse that will support the return of junit formatted results. I'm not sure the exact date, but when they do, the need for a separate transform activity should go away.

It should be possible soon to run the test in hudson with the new -c command line argument to run the test and then run it a second time with a -c argument to request the latest results for the test in junit format. The same should apply for suites.

I will come back an update when the release is out that has that functionality working.

I'm back. The -c approach still has some work to do, however there is a new Hudson Plugin which you can install directly from within Hudson. It isn't the idea solution for my team right now, but it is working for some teams.

To get it:

  1. Upate to 1.350 or higher Hudson
  2. Click on Manage Hudson
  3. Select Available Plugins
  4. Search for FitNesse on the page
  5. Install that plugin
  6. Configure it t point to your fitnesse.jar and FitNesseRoot.


Not sure if it's exactly what you're after but if you install the Fitnesse plugin, you can add a build step which outputs xml.

Display Fitnesse XML reports within Hudson GUI

And then you can publish those results from the xml as a post-build action.

Display Fitnesse XML reports within Hudson GUI

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜