astropy / astroscrappy

Speedy Cosmic Ray Annihilation Package in Python
70 stars 34 forks source link

Coverage report is incorrect #30

Closed astrofrog closed 4 years ago

astrofrog commented 7 years ago

At the moment, the only files included in the 100% coverage number are two __init__.py files. I think there are ways to include Cython/C code in the coverage (this is done in Astropy core I believe)

cmccully commented 7 years ago

Can you elaborate? I am pretty sure I have seen the coverage go up after adding tests before.

astrofrog commented 7 years ago

If you look at the coverage report here, only two init.py files are included in the calculation: https://coveralls.io/github/astropy/astroscrappy

cmccully commented 7 years ago

Is that an issue here or with the package-template which defines the coverage utilities (or both)?

astrofrog commented 7 years ago

Well it might be nice for us to show in the template how to add coverage for cython code, but I think we can definitely fix it here (not many affiliated packages use C/Cython). I don't have time to look into it at the moment, but Astropy installs a few extra packages and adds some C compile flags for it to work: https://github.com/astropy/astropy/blob/master/.travis.yml#L111

cmccully commented 6 years ago

@astrofrog @bsipocz @eteq Can you comment on how this is supposed to work? I looked around but trying to follow the astropy travis setup didn't seem to work. Also I notice this issue is still open: https://github.com/astropy/astropy/issues/5184

cmccully commented 6 years ago

Possibly @mdboom or @jakevdp could comment on how this is supposed to work. I have tried (unsuccessfully) to mirror what is done in astropy's travis file.

bsipocz commented 6 years ago

I don't have a solution for you, but maybe switching to other coverage providers may solve the issue. E.g. I hear good things about codecov (but we yet to test it and possibly switch over with the astropy packages)

eteq commented 6 years ago

@cmccully - I could be wrong, but I was just looking at this elsewhere and I think the C-code coverage is checked independently using a coveralls tool meant for C code, which somehow hooks into the build process before the tests get run (hence the three-step process in travis). This PR seems to have done the magic: astropy/astropy#3960