Missed Team ’24? Catch up on announcements here.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Ant Build Failing with JUnit Tests

Deleted user August 16, 2017

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

0 votes
Jeyanthan I
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 17, 2017

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.

Deleted user August 17, 2017

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.

Jeyanthan I
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 17, 2017

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)

Deleted user August 17, 2017

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
TAGS
AUG Leaders

Atlassian Community Events