This issue is archived. You can view it, but you can't modify it. Learn more

ExportXMLWordPrintable

      I'm using TestNG 5.8 with Hudson 1.213. My issue seems similar to this issue:
      http://osdir.com/ml/java.hudson.user/2007-11/msg00014.html

      Hudson doesn't seem to pick up the TestNG results created by the Ant build
      script. The TestNG report is created without problems (using the testng task in
      Ant), but hudson doesn't seem to be able to "dig out" the test results from the
      testng-results.xml file. Below are the contents of the junitResult.xml file
      stored in the JOBNAME/lastSuccessful directory:

      <?xml version='1.0' encoding='UTF-8'?>
      <result>
      <suites>
      <suite>
      <name>(testng-results.xml)</name>
      <duration>0.0</duration>
      <cases/>
      </suite>
      </suites>
      <duration>0.0</duration>
      </result>

      (As you can see, hudson at least managed to identify the name of the testng
      report file)

      My test is just 1 single test class, that being the example TestNG has on their
      website. Here are the contents of the xml report generated by TestNG (testng-
      results.xml) :

      <testng-results>
      <reporter-output>
      </reporter-output>
      <suite name="Ant suite">
      <groups>
      <group name="fast">
      <method signature="SimpleTest.aFastTest()" name="aFastTest"
      class="SimpleTest"/>
      </group>
      <group name="slow">
      <method signature="SimpleTest.aSlowTest()" name="aSlowTest"
      class="SimpleTest"/>
      </group>
      </groups>
      <test name="Ant test">
      <class name="SimpleTest">
      <test-method status="PASS" signature="aFastTest()" name="aFastTest"
      duration-ms="2" started-at="2008-05-14T19:13:19Z" finished-at="2008-05-
      14T19:13:19Z">
      </test-method>
      <test-method status="PASS" signature="setUp()" name="setUp" is-
      config="true" duration-ms="20" started-at="2008-05-14T19:13:18Z" finished-
      at="2008-05-14T19:13:19Z">
      </test-method>
      <test-method status="PASS" signature="aSlowTest()" name="aSlowTest"
      duration-ms="0" started-at="2008-05-14T19:13:19Z" finished-at="2008-05-
      14T19:13:19Z">
      </test-method>
      </class>
      </test>
      </suite>
      </testng-results>

      The report is generated with this Ant task:
      <testng classpathref="test.classpath"
      outputDir="${test.results}"
      haltOnFailure="false"
      verbose="2"
      failureProperty="test.failed">

      <classfileset dir="${build.classes}" includes="**/*Test.class" />
      </testng>
      <fail message="Some tests failed! Check test reports." if="test.failed" />

      I did see that someone responded to the link I have at the top of this issue
      saying to add "reporter='org.testng.reporters.JUnitXMLReporter'" to the testng
      task in Ant. Is that required?

      I thought that Hudson supported TestNG out of the box without any
      modifications. The "Next Generation Java Testing" book makes mention of Hudson
      and it says "These tools will detect that TestNG is being used to run the tests
      and so will know how to interpret the results and show them using the server's
      UI rather than having to rely on TestNG's HTML output....The way this works is
      that the build tool parses ant's build.xml file, and when it sees a TestNG
      invocation, it registers its own build listeners with TestNG and then receives
      callbacks when tests are run, as well as info about test results". The info
      may no longer be valid though, since there have been subsequent releases of
      Hudson.

      Is there perhaps just a configuration change I need to make?

            Assignee:
            Unassigned
            Reporter:
            tonyjoe
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Resolved:
              Archived: