Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to view code coverage in pull requests

Hendrik Wouters
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!
September 5, 2025

In my pull request CI pipeline, I run PHPUnit and i let it generate a code coverage report.

 

Documentation is severely lacking, but based on https://community.atlassian.com/forums/Bitbucket-questions/How-to-enable-code-coverage-in-bitbucket-piplines-for-my-Laravel/qaq-p/859406 I made this:

 

pipelines:
pull-requests:
'**':
- step:
name: Unit tests
script:
- XDEBUG_MODE=coverage ./vendor/bin/phpunit --coverage-clover test-reports/coverage.xml
artifacts:
- test-reports/**

 

The coverage.xml is included in the artifacts. but nothing is shown on the pull request page in BitBucket.

How do I get the code coverage visible in the pull request?

 

I am looking for the BitBucket equivalent of this: https://docs.gitlab.com/ci/testing/code_coverage/

 

Ideally, I would like to see how a PR affects code coverage (higher or lower) so that we can act on that.

 

2 answers

1 vote
Ulrich Kuhnhardt _IzymesCo_
Atlassian Partner
September 7, 2025

Could you possibly utilise Bitbucket code insights - https://support.atlassian.com/bitbucket-cloud/docs/code-insights/ to display code coverage reports from your pipeline?

1 vote
Aron Gombas _Midori_
Community Champion
September 5, 2025

I don't think you can view any kind of coverage report on the pull request screen.

As in the old topic suggested, you should instead:

  1. Integrate the coverage tool to your pipeline
  2. Let that produce its report output
  3. Make the output downloadable (e.g. by creating a downloadable artifact from it, this is what we do with our massive pipeline logs so that we can "grep" them locally)

I think currently this is the only way to approach it.

Hendrik Wouters
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!
September 5, 2025

Hi Aron, thanks for taking the time to reply!

 

This is seriously disappionting, but knowing this i at least won't waste more time on trying to get this to work.

 

Thanks!

 

And Atlassian folks, if you're reading this: any chance you are working on this?

Ben
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 8, 2025

Hi @Hendrik Wouters 

To echo what @Ulrich Kuhnhardt _IzymesCo_ has mentioned - it might be worthwhile looking into the CodeInsights feature to determine if this may handle your usecase: 

https://support.atlassian.com/bitbucket-cloud/docs/code-insights/

We do have a feature request raised with our developers for enabling code coverage in PR's, you may Watch this to receive future updates related to it and Vote for it to improve its visibility with regard to customer demand:

Cheers!

- Ben (Bitbucket Cloud Support)

 

Suggest an answer

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

Atlassian Community Events