It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

codecov.io bash script gives error in combination with Bitbucket pipelines

Luc Wollants Jun 25, 2017

I did set up a private repo on Bitbucket to host a PHP project. For this project I also use the pipelines integration.

This is the content of my pipelines yaml file:

image: php:7.1.4

pipelines:
default:
- step:
script:
- ./install_xdebug.sh
- ./install_mailhog.sh
- ./install_composer.sh
- composer install
- vendor/bin/phpunit --coverage-clover=coverage.xml
- if [ $? -eq 0 ]; then bash <(curl -s https://codecov.io/bash); fi

I'm able to generate a code coverage file with Xdebug:

Generating code coverage report in Clover XML format ... done

The next part is uploading this file to codecov.io but this part fails with an error

x> No CI provider detected.
Testing inside Docker? http://docs.codecov.io/docs/testing-with-docker
Testing with Tox? https://docs.codecov.io/docs/python#section-testing-with-tox
project root: .
/dev/fd/63: line 739: git: command not found
/dev/fd/63: line 739: hg: command not found
--> token set from env
Yaml not found, that's ok! Learn more at http://docs.codecov.io/docs/codecov-yaml
==> Running gcov in . (disable via -X gcov)
==> Searching for coverage reports in:
+ .
-> Found 1 reports
==> Detecting git/mercurial file structure
==> Reading reports
+ ./coverage.xml bytes=81581
==> Appending adjustments
http://docs.codecov.io/docs/fixing-reports
+ Found adjustments
==> Uploading reports
url: https://codecov.io
query: branch=&commit=&build=&build_url=&name=&tag=&slug=&yaml=&service=&flags=&pr=&job=
-> Pinging Codecov
HTTP 400
missing required properties: [&#39;commit&#39;]

1 answer

1 vote
Marek Parfianowicz Atlassian Team Jul 31, 2017

It seems that your script throws errors due to missing git and hg executables, followed by a failed upload to codecov.io. As you can see the query sent has an empty "commit" argument, which is mandatory.

Luc Wollants Jul 31, 2017 • edited

Correct, I found  it a few days ago: https://stackoverflow.com/questions/44749241/codecov-io-gives-error-in-combination-with-bitbucket-pipelines

 

Feel free to accept the answer on stackoverflow ;)

Suggest an answer

Log in or Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Published in Bitbucket Pipelines

Building a Bitbucket Pipe as a casual coder

...ipe.sh :  #!/bin/bash source "$(dirname "$0")/common.sh" enable_debug extra_args="" if [[ "${DEBUG}" == "true" ]]; then extra_args="--verbose" fi # mandatory variables R...

3,029 views 1 20
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you