Louis Charette
Louis Charette

Reputation: 1331

Codecov : No coverage report created on git merge operation

For our repos, we only push directly to hotfix or develop branch, never to the master branch. We merge from develop/hotfix into master branch only.

Problem is Codecov merges all reports for a specific branch, not taking the branch into perpsective. This means our "master" branch will always be empty on Codecov, unless we push directly to it.

For example :

  1. Commit to develop
  2. Travis run test on the develop branch, send report to Codecov
  3. Codecov adds the report as develop branch
  4. Git Merge develop into master
  5. Travis run test on the master branch, send report to Codecov
  6. Codecov merge the report from master into develop report

    Result : No reports available for master branch, badge still shows "Unknown" for master branch.

See an example repo :

For example, the Update README.md merge commit ( 93a3d5d ) on the master branch didn’t trigger a report on the master branch on Codecov. You can see the Travis build for both branch that successfully send in the reports.

How can we make sure the reports are synched with master without :

  1. pushing a unique commit to master first
  2. make the develop branch the default one on codecov
  3. use the default branch badge in our Reame

Upvotes: 2

Views: 1824

Answers (1)

Louis Charette
Louis Charette

Reputation: 1331

For anyone finding this question and having the same problem, the simple answer is to merge from hotfix to master using a Pull Request instead of a normal merge. The Pull Request also have the advantage of running all tests (and other CI services, such as style check) before the merge operation, avoiding a post merge test failure due to merge conflict. Since the PR create a new merge commit, the reports on Codecov will be updated after the merge.

Upvotes: 1

Related Questions