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.
Could you possibly utilise Bitbucket code insights - https://support.atlassian.com/bitbucket-cloud/docs/code-insights/ to display code coverage reports from your pipeline?
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:
I think currently this is the only way to approach it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.