JUnit + TeamCity not showing test results when using Ant Task <junit...

So we have 16 build agents.  14 of them seem to be reporting junit test results correctly.  The other 2 build agents are not.  These build agents were just recently added into the pool of build agents.  All build agents use ant 1.6.5.  All build configurations use the same ant tasks to execute builds and running unit tests.  Is there something on the TC server I need to do to get TC to recognize unit tests on these 2 build agents?  We are using TC 4.5.  All build agents are 4.x build agents.

Comment actions Permalink

Still needing help?  Anybody?

Comment actions Permalink

Did you try to start your build manually on those 2 agents? Does it run your tests?

Comment actions Permalink

I see all the tests ruuning.  They are being logged to the teamcity-build.log.  Now we have 3 vms each with 4 build agents.  We use Ant 1.6.5 and the 2 build agents having a problem are on different vm instance meaning the other 3 on those servers are working as expected and production the test result from teamcity.

Comment actions Permalink

Can you provide a build log?

Comment actions Permalink

Pavel, you been able to look at this yet?

Comment actions Permalink

Yes I did, but so far I do not have ideas why your build do not report tests on those new agents. Perhaps they have different environment. Could you please also provide TeamCity build log, not the build.log file from the agent, but build log downloaded from the TeamCity web UI.

Comment actions Permalink

The one thing to remember is that there are 4 agents per machine and 3 of the 4 act properly while the 4th one does not process the results.
Seems to be related to the build agent.  I did fine something in the agent log file.  The runtime CP's are different.  I noticed we are not doing anything special in the build configuration as far as adding additional ant parms.  where can I set the CP for server.agent.ant.AntBuildRunner?

Here is the runtime CP of one that works.

[2010-10-07 19:23:05,661]   INFO - erver.agent.ant.AntBuildRunner - Ant Runner
xtensions: jetbrains.buildServer.agent.ant.JUnitFirstTestsToRunExtension,jetbr
[2010-10-07 19:23:05,663]   INFO - erver.agent.ant.AntBuildRunner - Runtime cl
[2010-10-07 19:23:05,663]   INFO - er.agent.runner.PropertyFinder - Took value
or ant.home from env.ANT_HOME, value: /usr/local/teamcity/apache-ant-1.6.5
[2010-10-07 19:23:05,663]   INFO - erver.agent.ant.AntBuildRunner - Using Ant
om: /usr/local/teamcity/apache-ant-1.6.5

Here is the runtime CP of the one that does not work.
[2010-10-08 07:21:13,658]   INFO - erver.agent.ant.AntBuildRunner - Ant Runner E
xtensions: jetbrains.buildServer.coverage.AntCoverageAdapter,jetbrains.buildServ
[2010-10-08 07:21:13,662]   INFO - erver.agent.ant.AntBuildRunner - Runtime clas
[2010-10-08 07:21:13,662]   INFO - er.agent.runner.PropertyFinder - Took value f
or ant.home from env.ANT_HOME, value: /usr/local/teamcity/apache-ant-1.6.5

Comment actions Permalink

As far as I can see the classpaths are the same, but their order is different. I do not think this is the cause of the problem. Is there something special about Ant on buildAgent4? Have you tried to use Ant bundled with TeamCity agent?

Comment actions Permalink

Ant 1.6.5 is shared among all 4 build agents on that machine.

ANT_HOME /usr/local/teamcity/apache-ant-1.6.5
JAVA_HOME /usr/local/websphere/jdk1.6.0_16
WEBSPHERE_JDK /usr/local/teamcity/was/runtimes/base_v7/java

Junit task in build.xml.  This is shared for all configurations on all build agents.

<junit printsummary="on" haltonerror="true" haltonfailure="true" reloading="false">


<path refid="project.unit.test.classpath" />

<pathelement location="${make.war.dir}/${project.name}/war/WEB-INF/classes" />

<path location="${project.src.root}/WebContent" />


<formatter type="brief" usefile="false" />

<batchtest fork="false">

<fileset dir="${project.unit.test.compile.root}">

<exclude name="**/Abstract*.class" />

<exclude name="**/Base*.class" />

<include name="**/*Test.class" />

<include name="**/*TestCase.class" />




Comment actions Permalink

What if you set fork=true with forkMode=once yo your junit task? Does it help?


Please sign in to leave a comment.