TestNG integration with TeamCity?

Hi, I'm evaluating IntelliJ and TeamCity support for Java unit testing. I was able to get JUnit tests to run, but it seems that TeamCity wants to use JUnit to also run my TestNG unit tests.

Any guidance for integrating TestNG unit tests in TeamCity? My project has one class file with JUnit tests, and another with the same tests, but ported to the TestNG framework.

I was able to get it to find the JUnit tests by choosing "throughout all project sources" in the "Search for tests" dropdown--no docs on what this does; with "in test sources only", no tests are found.

I can't find any docs on how to tell TeamCity about the TestNG tests.


1 comment
Comment actions Permalink

TeamCity IPR runner supports JUnit tests only. If you need to run TestNG tests as well, I would suggest you to use Ant runner. If you do not have Ant build.xml file you can generate it from IntelliJ IDEA (it will have compilation tasks only), then import it into hand written build.xml which will start your tests. TeamCity recognizes TestNG and JUnit tests started from Ant.

Pavel Sher


Please sign in to leave a comment.