Ant Build Failing with JUnit Tests

My JUnit Parser task fail with "Failing task since test cases were expected but none were found." message.
I configured JUnit Parser with path ${bamboo.build_home}/log/junit/*.xml
From logs:
Substituting variable: ${bamboo.build_home} with /opt/tools/build/current
simple 17-Aug-2017 00:02:47 Starting task 'Get JUnit results' of type 'com.atlassian.bamboo.plugins.testresultparser:task.testresultparser.junit'
simple 17-Aug-2017 00:02:47 Parsing test results under /home/bamboo/bamboo-agent-home/xml-data/build-dir/WEB6-W6IT0-BH...
simple 17-Aug-2017 00:02:47 Failing task since test cases were expected but none were found.
simple 17-Aug-2017 00:02:47 Finished task 'Get JUnit results' with result: Failed

I added script task with command ls /opt/tools/build/current/log/junit/ - i can see TESTS-TestSuites.xml file in /opt/tools/build/current/log/junit/ folder.

Why bamboo try to look tests under /home/bamboo/bamboo-agent-home/xml-data/build-dir/WEB6-W6IT0-BH... folder? It should be /opt/tools/build/current/log/junit/*.xml
How i can see full path for message - /home/bamboo/bamboo-agent-home/xml-data/build-dir/WEB6-W6IT0-BH...?

1 answer

Hi Maxim,

By default, files created before the current build will be analysed. As you want to set test results outside the build directory, you will have to enable "Pick up test results that were created outside of this build" under Advanced options in your JUnit Parser task.

It is enabled. The behavior the same for collect test results inside task or as as additional step. I can't get tests results, but i can see test files by ls command.

Hi Maxim, I just tested and found that you can only enter a relative path and navigate within the build directory and never outside a build directory.

Eg. When you enter test-results/*.xml , it looks for xml files under your build directory /home/bamboo/bamboo-agent-home/xml-data/build-dir/WEB6-W6IT0-BH/test-results 

So, the best approach would be copying the files to the build directory. (I'll work with our documentation team to make this clear in the documentation).

PS. When you check Pick up test results that were created outside of this build, it means that Bamboo will no longer verify the timestamp of the xml file creation time whether it is created after the build was started. (I was wrong in my previous update)

I found it ~1 hour ago. I can configure log folder, so i provided environment variable LOG_DIR=${bamboo.build.working.directory}/log. As result all logs and tests results located in build directory and i can see tests results.

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published May 18, 2017 in Bamboo

FAQ: How to Upgrade Bamboo Server

Bamboo 5.9 will no longer be supported after June 12, 2017. What does this mean? As part of our End of Life policy, Atlassian supports major versions for two years after the first major iteratio...

1,562 views 0 6
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you