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

Test coverage #5

Closed
perrygeo opened this issue Jul 27, 2016 · 4 comments
Closed

Test coverage #5

perrygeo opened this issue Jul 27, 2016 · 4 comments

Comments

@perrygeo
Copy link
Contributor

We need to do more direct unit tests and make sure we're hitting all the code.

@virginiayung
Copy link
Collaborator

Per chat with @perrygeo last Friday, I'm going to refactor pansharpen python api (#8) and write unit tests that test specific behaviors of numpy array calculations. A good example of this kind of direct unit testing would be what @dnomadb wrote in test_make_lat_lngs, which tests specifically the creation function for latitude and longitude in rio-toa's test_sun_utils.py.

@virginiayung virginiayung mentioned this issue Aug 1, 2016
3 tasks
@virginiayung
Copy link
Collaborator

virginiayung commented Aug 4, 2016

I added more property-based tests in PR #13.

Problems:

  1. Tests passed locally and on circleci (Python 2.7.10 and 3.5.0) but coverage data is not being sent to Coverage.py and I got this warning:
    Coverage.py warning: No data was collected..
  2. I'm also wondering why it's running on 2.7.6 when I specified pyenv local version to be 2.7.10 in circle.yml

screen shot 2016-08-04 at 11 25 55 am

Possible culprit:

I suspect that the problem lies with pytest-cov. Relative paths are confusing coverage when the measured script is run from another directory. Digging into this now.

Running pytest locally with the same flags: py.test --cov pansharpen --cov-report term-missing --ignore=venv

screen shot 2016-08-04 at 12 09 00 pm

@virginiayung
Copy link
Collaborator

My workaround for now is to use versions of Python pre-installed by Circleci on Ubuntu 12.04 and Ubuntu 14.04 build images and run tests on Python 2.7.11 and 3.5.0 separately. Currently our test coverage is 96%

2.7.11 Build

screen shot 2016-08-04 at 6 26 17 pm

3.5.0 Build

screen shot 2016-08-04 at 6 25 35 pm

@virginiayung
Copy link
Collaborator

virginiayung commented Aug 5, 2016

🚢 in PR #13. I'm closing this ticket for now. We can revisit tests later!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants