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.

 

1 answer

0 votes
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?

Suggest an answer

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

Atlassian Community Events