Can JUnit Parser Task select a directory outside of the job directory?

I want to split my build into a Build and a Test Job. I can set working directory on script tasks so my test job runs in the build job's directory.

When I set JUnit Parser to look for custom results directory I see test results but get a failure message "Could not find test result reports in the /opt/builds/build-dir/PROJ-PLAN-TEST directory."

JUnit Parser Setting: ../PROJ-PLAN-BUILD/**/target/surefire-reports/*.xml

Has anyone done this kind of split?



2 answers

1 accepted

Bamboo 4.4.2 JUnit Parser bug blocks normal use of shared dependencies. For a viable multi job project one should:

  • Create share test-results artifact in test job
  • Depend on test-results artifact in subsequent report job
  • Add script in report job that copies files to a new location
    • Moving directory - not enough
    • Touch files in place to set modification dates - not enough
  • Point JUnit Parser at the copied files

Running on linux, I added a script task to copy the files

if [ -d generated ]; then
  rm -rf generated
mkdir generated

rsync -av target generated

I'm told this bug is fixed in 5.0.1 but upgrading bamboo is a multi-week endeavor that needs to be scheduled carefully.

The solution is to share test results artifact from "BUILD" job and depend on it in "TEST" job. This copies the results between the two jobs which would be essential if the jobs execute on different systems.

Related Link:

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,804 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