TestNG with JUnit compatibility

We are in the process of migrating our project from JUnit to TestNG. During the migration, we are running all tests (JUnit-style and TestNG-style) with the TestNG test runner, using the JUnit compability mode for the unmigrated tests. The testng-config.xml file used to run the tests looks something like this:

<suite name="Custom suite">
  <test name="junit" junit="true">
    <classes>...</classes> <!-- unmigrated test classes listed here -->

  </test>
  <test name="testng" junit="false">
    <classes>...</classes> <!-- migrated test classes listed here -->
  </test>
</suite>

The tests are run in TeamCity using the Ant runner. All of the tests are run, but TC does not seem to recognize the JUnit tests. The TC listenener does not count the JUnit tests as tests are being run, does not include them in its total test count, and does not include them on the "Tests" tab.

We are using TC 4.0 (planning to upgrade to 4.5.x soon :-). Is this a known problem, and has it been fixed in newer versions fo TC?

2 comments
Comment actions Permalink

No, this is not a known problem, please submit a bug report to our tracker: http://jetbrains.net/tracker
As for 4.5, in this version a workaround is possible, you can generate JUnit like report from test ng task and import it into TeamCity with help of new plugin bundled with TeamCity 4.5. The plugin settings are at the bottom of the Ant runner settings page.

0
Comment actions Permalink

Issue JT-511 has been opened.

0

Please sign in to leave a comment.