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?
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.