The current version of Teamcity does not provide a separate build step for JUnit.
I assume this is due to the problem of defining a test class.
You can explicitly specify the path to the ant junit task classes.
Or Teamcity can get the class test path from IDEA or IPR . These two links explain how to run junit tests as part of the compilation build step.
source share