fabric8-analytics / fabric8-analytics-server

fabric8-analytics API server
Apache License 2.0
16 stars 56 forks source link

RFE: figure out how to measure code coverage for unit test #29

Closed tisnik closed 7 years ago

fridex commented 7 years ago

I use codecov.io in selinon - see https://github.com/selinon/selinon/pull/29 for a report example. It's easy to setup and gives nice stats.

tisnik commented 7 years ago

Oh very cool @fridex . Do you think it would be possible to use it in ./runtests.sh (let's say when I set some flag or environment variable)? It would be very nice to have such numbers in test reports :)

fridex commented 7 years ago

I use a py.test extension pytest-cov ( see https://github.com/codecov/example-python#pytest for an example) where you specify just path to a python package [1]. I think this should be doable for api unit tests and for worker unit tests as well. We will need to register at codecov.io to get this.

[1] https://github.com/selinon/selinon/blob/master/Makefile#L34

fridex commented 7 years ago

@tisnik I've added fabric8-analytics to codecov - any member from this org can access codecov just by signing in with GitHub account. Feel free to contact me if any issue spotted.

EDIT: link is https://codecov.io/gh/fabric8-analytics

tisnik commented 7 years ago

IIRC the codecov.io is a site that just displays test results acquired from the local machine/Jenkins instance, right? So we still need to generate the report. I'll look at it.

fridex commented 7 years ago

IIRC the codecov.io is a site that just displays test results acquired from the local machine/Jenkins instance, right? So we still need to generate the report. I'll look at it.

Yes, the report is aggregated locally but it is sent to codecov.io - see py.test plugins. Thanks!

samuzzal-choudhury commented 7 years ago

This issue was moved to openshiftio/openshift.io#837