TeamCity
 
You are viewing the documentation for an earlier version of TeamCity.

Ant

Last modified: 20 April 2023

This is a runner for Ant build.xml files. TeamCity 10.0.x comes bundled with Ant 1.9.7, TeamCity 2017.1 - Ant 1.9.9.

Testing Frameworks Support



The TeamCity Ant runner supports the JUnit and TestNG frameworks. When tests are run by the junit and testng tasks directly within the script, TeamCity reports tests on the fly.

By using the <parallel> tag in your Ant script, it is possible to have the JUnit and TestNG tasks run in parallel. TeamCity supports this and should concurrently log the parallel processes correctly.

Reporting and Logging



TeamCity collects detailed data from Ant as to the performed activities, provides structured error reporting, and reports tests. However, you can start a build with no specific reporting or to turn off TeamCity-specific logging:

Ant Runner Settings



Ant Parameters



ant-net-tasks Tool



The Ant build runner comes with a bundled tool, ant-net-tasks, which includes the jar files required for network tasks, such as FTP, sshexec, scp and mail. It also contains missing link Ant task which can be used for REST requests.

To use the tool, specify -lib "%\teamcity.tool.ant-net-tasks%" in Additional Ant command line parameters of the runner settings.

antTestParametersTestparametersTest Parameters



Tests reordering works the following way: TeamCity provides tests that should be run first (test classes), after that, when a JUnit task starts, it checks whether it includes these tests. If at least one test is included, TeamCity generates a new fileset containing included tests only and processes it before all other filesets. It also patches other filesets to exclude tests added to the automatically generated fileset. After that JUnit starts and runs as usual.

Docker Settings



Code Coverage



To learn about configuring code coverage options, refer to the Configuring Java Code Coverage page.