Tigge/antfs-cli

Unit tests + TravisCI

Closed this issue · 6 comments

Maybe you already know TravisCI, but this service is great to build and run unit tests on each push performed, against each supported python version.

This could be added on this project, but also on openant project. I can make the travisCI configuration and CI build in setup.py if you want @Tigge, but you will have to configure the TravisCI webhook in github (Step 1 & 2 in the link) for both projects.

Also, coveralls.io is as service for measuring code coverage on unit tests, could be nice to include too.

Also we could use setuptools instead of distutils. (for example, to make python setup.py test just works).

The following is just an idea, as there are already unit tests included in openant : Maybe we could add a feature to "record" a real device messages at some time, to be able to replay it for test purposes. I think we could add a test to simulate download and upload for each supported device.

I'm all for resources that can help with testing in any way so I'll be happy to add any hooks needed or anything else. It is probably most interesting to start with openant, there are a few unittest there that doesn't require a device so those can be set up and made to run right away. In comparison with openant, antfs-cli is actually rather tiny. But if you or anyone else want to add more unit tests to either of the projects no one would be more happy then me 😄.

Moving from distutils to setuptools is also fine by me, seems the later is the preferred way nowadays.

Using fake device data with test in openant is certainly a good thing to do, whether that is recorded or just constructed or simulated in some way. With more development two clients running openant should be able to talk with each other as well, could be interesting for tests.

But let's start with the configuration and test in setup.py and then I'll set up that hook.

Thanks ! Could you add coveralls.io too ? Having the code coverage figures will help to try to increase it :) I'll make a PR with setuptools and .travis.yml configuration file.

I've opened PR in both projects @Tigge, let's try merging the one from openant it should then run tests in travisCI and add upload code coverage to coveralls.IO.

And we can close this now. Thanks!