galaxyproject / ephemeris

Library for managing Galaxy plugins - tools, index data, and workflows.
https://ephemeris.readthedocs.org/
Other
27 stars 38 forks source link

Add pytest, enable coverage testing, fix key issue #105

Closed rhpvorderman closed 5 years ago

rhpvorderman commented 5 years ago

Hi. I set out to fix #82 . Then I figured this would be much easier to test using pytest. So I set up pytest as well. Since we use tox, I followed the set of recommendations here: https://docs.pytest.org/en/latest/goodpractices.html Also that lead me here: https://blog.ionelmc.ro/2014/05/25/python-packaging/#the-structure

That is why we now have a src/ folder. I needed to adapt setup.py for that as well. But it should still work.

I also took the opportunity to enable the code to integrate the coverage results with codacy. But I need @jmchilton to integrate that fully. Alternatively I could set up a galaxyproject organization on codacy, but I am not going to do so without explicit permission from a galaxy core member,and certainly not without bypassing John. That is just not a nice thing to do, given he has set up codacy already on his personal codacy page.

I removed some redundant code from the testing files as well. But with me not being involved from the beginning of this project, this might lead to errors later. So reviews are quite welcome.

@erasche, could you check if this fixes #82? @jmchilton could you have a look as well, given that you release the ephemeris package and I had to change setup.py?

This also adresses #71 and #80 .

Best regards, Ruben

rhpvorderman commented 5 years ago

Implemented docker in the pytest testing at this point. Probably should use fixtures and data providers as well in synergy with this. This might take me some hours to implement properly.

rhpvorderman commented 5 years ago

I have created a new codacy page: https://app.codacy.com/project/galaxyproject/ephemeris/dashboard I also created a galaxyproject group for this. @jmchilton is also admin of this group. On this codacy I disabled the assert warnings. Also coverage is integrated with this codacy page. The advantage of a more general "galaxyproject" codacy is that more people can control the project.

rhpvorderman commented 5 years ago

Okay I am done. Made sure the docker container is a fixture so it is automatically deleted after the tests are done. Coverage is also integrated. I think everything is set up for a completely new test environment. Now we only need to improve coverage by writing more test. But that is something for the future.