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

Can I display unit test results in the Pull Request page?

chris_cooper
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 15, 2024

I'm working on an Azure pipeline that, when triggered by a pull request, builds the project, runs the unit tests, and triggers SonarCloud to do a static analysis.  The SonarCloud part is great, the results of that analysis show up in the middle of my Pull Request and it's very easy for reviewers to make sure the static analysis is acceptable.

But I want something similar for the unit test results.  Right now, the unit test results seem to only be available inside Azure, and I can't find any way to have them show up anywhere on the BitBucket Pull Request screen.  BitBucket does make it easy to jump into Azure to see results, but that requires separate Azure licenses for all my users which I'm trying to avoid.

Is there a way for Azure to send the unit test results file to BitBucket as a "report" (bottom-right corner of the Pull Request screen, like SonarCloud does)?  Or maybe Azure can send the unit test results to BitBucket as an attachment to the Pull Request?

1 answer

0 votes
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 18, 2024

Hi Chris and welcome to the community!

Reports that show up in the Reports section of a Pull Request are created with API calls. We provide API endpoints for creating a report, annotations within a report, deleting a report, etc.

You can find a list of all API endpoints related to reports here:

You can navigate to the different API endpoints from the left sidebar on that page. This page from our documentation also has some useful info:

If SonarCloud creates reports, then I assume it is using our APIs to do this. If there is no available integration that does the same for your unit test results, then you could develop a tool that uses our APIs to create reports based on your unit test results. Please keep in mind there is a limit of 10 reports per commit and 1000 annotations per report.

With regards to PR attachments, I'm afraid that we don't have an API endpoint to add an attachment to a Pull Request. Attachments can only be added from our website, so I don't think this can be automated from your build.

Please feel free to reach out if you have any questions.

Kind regards,
Theodora

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events