Missed Team ’24? Catch up on announcements here.

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

Bitbucket Status API: How I can add test results to build status on pull request

Deleted user June 13, 2019

I want to add test results to build status on pull request. I only found Bitbucket Status endpoint for Commits. If I add a build status for an commit, which is in a Pull Request, does the pull request shows that build status too? Or how it will work?

The next Question is how we can add our test results (multiple JUnit ".xml" Documents) to the build status. Is there an example how to add a test result to the the status endpoint?

1 answer

0 votes
Daniil Penkin
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 20, 2019

Hi @[deleted],

If I add a build status for a commit, which is in a Pull Request, does the pull request shows that build status too?

Yes, this is exactly how it works: Pull Request shows build statuses for the commit on the tip of the source branch. If the source branch is updated, PR will stop showing status until a build status for the new tip commit is available.

As for the multiple build statuses, you just need to send a POST request for each build result with different key (build key) attribute, see Multiple builds section here. It is up to you how you parse multiple JUnit documents and aggregate test results. If you plan to use Bitbucket Pipelines, you'll get build statuses for JUnit-style tests reported to Bitbucket right out of the box.

Hope this helps.

Cheers,
Daniil

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events