Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

codecov integration #525

Merged

Conversation

ricardogsilva
Copy link
Member

Overview

This PR brings integration with the codecov service.

The general idea is that our CI service will run the tests with coverage.py and afterwards upload coverage results to codecov. This involves running parallel coverage and then combining everything in the end.
It will be using the new multi-stage capabilities in Travis (which are awesome by the way).

Related Issue / Discussion

See #511

Additional Information

Contributions and Licensing

(as per https://github.com/geopython/pycsw/blob/master/CONTRIBUTING.rst#contributions-and-licensing)

  • I'd like to contribute [feature X|bugfix Y|docs|something else] to pycsw. I confirm that my contributions to pycsw will be compatible with the pycsw license guidelines at the time of contribution.
  • I have already previously agreed to the pycsw Contributions and Licensing Guidelines

Exploring with the new travis build stages feature too
@ricardogsilva
Copy link
Member Author

@tomkralidis
In order to complete this I'm going to need you, as github admin to enable pycsw integration with codecov. I'm not blocked for now, as I'm testing against my own fork. Let's meet on gitter sometime this week or next (at your convenience) and I can walk you through it if needed.

@tomkralidis
Copy link
Member

@ricardogsilva I've enabled codecov is integration for pycsw. Do we need to close/reopen this PR?

@tomkralidis tomkralidis closed this Jun 5, 2017
@tomkralidis tomkralidis reopened this Jun 5, 2017
@tomkralidis
Copy link
Member

Reopening, travis ci running.

@ricardogsilva
Copy link
Member Author

@tomkralidis the work is not finished yet.

I'll ask for review when it seems ready to merge

Codecov is finding files named coverage.xsd and it thinks these are
coverage files. Disabling directory crawling might do the trick
@codecov
Copy link

codecov bot commented Jun 6, 2017

Codecov Report

❗ No coverage uploaded for pull request base (master@6ef74f6). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##             master     #525   +/-   ##
=========================================
  Coverage          ?   56.04%           
=========================================
  Files             ?       29           
  Lines             ?     6320           
  Branches          ?     1338           
=========================================
  Hits              ?     3542           
  Misses            ?     2400           
  Partials          ?      378
Flag Coverage Δ
#integrationtests 54.69% <ø> (?)
#unittests 7.61% <ø> (?)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6ef74f6...2a117d7. Read the comment docs.

@ricardogsilva
Copy link
Member Author

@tomkralidis @kalxas
I think this is done.

As you can see (from this PR) we will now have a codecov bot analyzing PRs and indicating code coverage status. In this case, since it is the first time that we are adding codecov it cannot compute the difference between the PR and the master branch, and that is why it is showing a failed check. Other codecov functionality is not working very well yet, due to the same problem. This will be fixed once we merge codecov integration into master.

Later on we can configure the codecov settings by adding a .codecov.yml file to the repo.

I think I won't be adding a coverage badge to the README yet because with the default codecov settings it would have a red color, since our global coverage is at 56% and the badge only turns green from 70% up. We could decide what a nice value for green would be, configure codecov appropriately and then add a badge to the README. What do you think?

Another thing implemented in this PR is usage of Travis' build stages. If you check Travis you'll see that we now have a unit-test and an integration-test stage. Stages run sequentially (first unit tests then integration tests). If one stage fails the following stages don't run. Inside each stage we have three 3 concurrent jobs, one for each python env (2.7, 3.4, 3.5). Each job of the same stage runs in parallel.

@ricardogsilva ricardogsilva changed the title WIP: codecov integration codecov integration Jun 6, 2017
@tomkralidis
Copy link
Member

cc @kalxas

Thanks @ricardogsilva. Should we keep with 70% code coverage with the goal to improve or lower our baseline? Thoughts?

I like the build stages and the early failure approach the provide.

+1 for merge pending decision on coverage threshold value.

@kalxas
Copy link
Member

kalxas commented Jun 6, 2017

Thanks @ricardogsilva
+1 for the proposed changes
Lets not add the codecov badge yet.

@tomkralidis tomkralidis merged commit ac9cddc into geopython:master Jun 6, 2017
@ricardogsilva
Copy link
Member Author

Let's discuss the threshold for green coverage on the next dev meeting

@tomkralidis
Copy link
Member

+1. Added to draft agenda.

@ricardogsilva
Copy link
Member Author

FYI, now that is has been merged you can go to

https://codecov.io/gh/geopython/pycsw

and see a detailed view on the coverage of each file, with line by line visualization of code covered (green), missed (red) and partially covered (yellow)

minhd added a commit to minhd/pycsw that referenced this pull request Jun 9, 2017
* master:
  Do not silence exceptions on custom plugins (geopython#487) (geopython#527)
  decouple requirements files in lieu of assembling via tox config (geopython#521) (geopython#497)
  from mock import Mock as MagicMock
  codecov integration (geopython#525)
  fixed code review issues
  version is now stored on a single file, VERSION.txt
  removed python 2.6 from the tox settings
  fix ref (geopython#514)
  Fixed harvesting WMS. calling undefined function (geopython#518)
@ricardogsilva ricardogsilva mentioned this pull request Jun 14, 2017
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants