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.

11 comments

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

0

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.

0

Pavel, you been able to look at this yet?

0

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.

0

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
ns.buildServer.testng.TestNGFirstTestsToRunExtension,jetbrains.buildServer.cov
age.AntCoverageAdapter,jetbrains.buildServer.agent.ant.EchoAntExtension,jetbra
s.buildServer.agent.ant.CompilerAntExtension,jetbrains.buildServer.testng.Test
TaskExtension,
[2010-10-07 19:23:05,663]   INFO - erver.agent.ant.AntBuildRunner - Runtime cl
spath:
/usr/local/teamcity/buildAgent3/lib/server-logging.jar
/usr/local/teamcity/buildAgent3/plugins/antPlugin/lib/buildServerAntServerLogg
g.jar
/usr/local/teamcity/buildAgent3/lib/common-api.jar
/usr/local/teamcity/buildAgent3/lib/xstream-1.2.1.jar
/usr/local/teamcity/buildAgent3/lib/commons-codec-1.3.jar
/usr/local/teamcity/buildAgent3/plugins/coveragePlugin/lib/emma.jar
/usr/local/teamcity/buildAgent3/plugins/testNGPlugin/lib/testNGAntExtension.ja
/usr/local/teamcity/buildAgent3/plugins/coveragePlugin/lib/coverageAgentRuntim
jar
/usr/local/teamcity/buildAgent3/lib/xmlrpc-2.0.1.jar
/usr/local/teamcity/buildAgent3/lib/xpp3_min-1.1.3.4.M.jar
[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
er.agent.ant.EchoAntExtension,jetbrains.buildServer.testng.TestNGFirstTestsToRun
Extension,jetbrains.buildServer.agent.ant.JUnitFirstTestsToRunExtension,jetbrain
s.buildServer.agent.ant.CompilerAntExtension,jetbrains.buildServer.testng.TestNG
TaskExtension,
[2010-10-08 07:21:13,662]   INFO - erver.agent.ant.AntBuildRunner - Runtime clas
spath:
/usr/local/teamcity/buildAgent4/lib/xmlrpc-2.0.1.jar
/usr/local/teamcity/buildAgent4/plugins/testNGPlugin/lib/testNGAntExtension.jar
/usr/local/teamcity/buildAgent4/plugins/coveragePlugin/lib/emma.jar
/usr/local/teamcity/buildAgent4/lib/xpp3_min-1.1.3.4.M.jar
/usr/local/teamcity/buildAgent4/plugins/antPlugin/lib/buildServerAntServerLoggin
g.jar
/usr/local/teamcity/buildAgent4/plugins/coveragePlugin/lib/coverageAgentRuntime.
jar
/usr/local/teamcity/buildAgent4/lib/commons-codec-1.3.jar
/usr/local/teamcity/buildAgent4/lib/xstream-1.2.1.jar
/usr/local/teamcity/buildAgent4/lib/server-logging.jar
/usr/local/teamcity/buildAgent4/lib/common-api.jar
[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

0

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?

0

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">

<classpath>

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

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

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

</classpath>

<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" />

</fileset>

</batchtest>

</junit>

0

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

0

Please sign in to leave a comment.