Sometimes it comes down to RTFM...
What I was trying to do was run my tests with run-time (via JVM args and javaagent) or build-time (via Ant task) enhancement by configuring that in my Intellij run configurations. Unfortunately that is not supported.
http://confluence.jetbrains.net/display/TCD65/IntelliJ+IDEA+Project
TeamCity IntelliJ IDEA runner supports subset of IntelliJ IDEA
features:
JUnit 3.x/4.x -
- Test runner parameters are not supported
- running of the Ant or Maven before tests start is not supported
- alternative JRE is not supported
So my solution (which works as expected) was to configure the following steps in my TeamCity project config:
- Intellij Runner step - compile project
- Ant step - build-time enhance
- Ant step - run tests
As I see it there is no way to accomplish this with a single Intellij Runner step in TeamCity using the intellij project and intellij run configurations.
I've filed a feature request with the TeamCity folks here:
http://youtrack.jetbrains.net/issue/TW-18739