It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

test-results are not created

Hi,

we are using the image atlassian/default-image:2 for our pipeline and we trigger ./gradlew test to run our unit tests. The tests are getting executed, but if the gradle task test is runs inside the image no test-reports are created.

We are using the standard gradle test task with enabled xml creation: test { reports { junitXml.enabled = true } } (gradle 5.3.1)

If I run ./gradlew test locally, the test-results and -reports folder are created. The image only creates the folders classes, generated, libs and tmp in the build folder.

Does anyone has an idea why this is working locally but not within the image? Should I switch to another image?

Best Regards

Alex

1 answer

0 votes

Hi @Alex Philippi,

It's possible that you don't need to add the junitXml.enabled = true line. Under the gradle heading of the documentation at https://confluence.atlassian.com/bitbucket/test-reporting-in-pipelines-939708543.html it says that gradle will emit test results in the expected format by default.

If removing this line doesn't work there are a few things you can try.

The first thing is to try to debug this locally but within a docker image (https://confluence.atlassian.com/bitbucket/debug-your-pipelines-locally-with-docker-838273569.html). This will help eliminate possible problems caused by running the build in a container. 

The second thing is add commands to the end of your build that will check whether the files are actually being created. My suggestion is to using the `ls` command on the test output folder to check that it is populated and then using the `cat` command to obtain the contents from those files to check that it is the same as the local versions.

Cheers,

Tom

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket Pipelines

What We Learned When We Researched Open Source Vulnerabilities in 7 Popular Coding Languages

...hey are a part of us, shaping how we interact with the world around us. The same holds true for programming languages when we think about how different kinds of vulnerabilities raise their heads in t...

1,034 views 0 3
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you