JUnit working locally but not in teamcity

same version of ANT (unmolested 1.7) in my local env and on the build agent machine... junit works locally, but on the agent I get the good old:

/opt/buildagent/temp/buildTmp/idea62637runner/test-output.xml:5: Problem: failed to create task or type junit Cause: the class org.apache.tools.ant.taskdefs.optional.junit.JUnitTask was not found. This looks like one of Ant's optional components. Action: Check that the appropriate optional JAR exists in -/usr/share/ant/lib -/home/build/.ant/lib -a directory added on the command line with the -lib argument ]]>

I haven't had to do anything special locally to make things work... I have copied the junit jar everywhere suggested on the agent machine, but that didn't work either.. I must be missing something obvious here...

shouldn't anything that works as an ant target for me locally work just the same in TeamCity?

4 comments
Comment actions Permalink

I should add that I can run the tests on the machine the build agent runs on as the user the build agent runs as, with no issue.

0
Comment actions Permalink

Hello,

Did you specify an alternate Ant home in build configuration settings (? If you don't have any particular reason to do this,
please try removing this setting (Step 3 in build configuration settings).

Besides junit.jar, you should make sure that your ant installation contains ant-junit.jar as well.

Kind regards,
KIR

0
Comment actions Permalink

everything is stock.. I have not specified an ant home.

0
Comment actions Permalink

Hello,

Could you please provide the following:

list of files in buildAgent/plugins/ant/lib directory
text of your junit task
version of JUnit you're using

Kind regards,
KIR

0

Please sign in to leave a comment.