Skip to content
This repository was archived by the owner on Mar 9, 2024. It is now read-only.

continuous integration goodies #26

Merged
merged 4 commits into from
Jun 12, 2018
Merged

Conversation

rooterkyberian
Copy link
Contributor

@emesik
Copy link
Contributor

emesik commented Jun 6, 2018

Hmm, I'm not familiar with CI at all, but now this PR seems to break tests:

$ python setup.py test
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
   or: setup.py --help [cmd1 cmd2 ...]
   or: setup.py --help-commands
   or: setup.py cmd --help

error: invalid command 'pytest'

I have pytest installed. It also signals an error when run in the project dir:

$ pytest
usage: pytest [options] [file_or_dir] [file_or_dir] [...]
pytest: error: unrecognized arguments: --cov=monero
  inifile: /home/emes/devel/monero-python/setup.cfg
  rootdir: /home/emes/devel/monero-python

class Tests(object):
__test__ = False
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so pytest will run all test_* methods assuming they are, well, tests.
This is of course a problem for test classes mixins. But then again, you are right in worrying about it as I clearly forgot to reenable it on subclasses.
Fixed in next commit.

@rooterkyberian
Copy link
Contributor Author

I should have both included some instructions in the readme (this is fixed now) from the beginning and description in the pull request explaining what have been done.

So this ticket introduces configuration for Travis CI, which uses pytest runner and Coveralls for showing both if tests are passing and the test coverage.
To enable it you will need to log in with github to both Travis CI http://travis-ci.org/ and Coveralls https://coveralls.io/ and active them for this project. After that and merging this PR tests will automatically start running for every new change commited and every new PR created - which makes reviewing contributions significantly easier. This services are de facto standard (and of course free) for open source projects hosted on github.

Now as to why replaced standard python unittest test runner with pytest. pytest is a very popular test runner for which you will have an easy time to find advantages over unittest module, and in this case, it was just that much easier to integrate test coverage analysis using it.

@emesik
Copy link
Contributor

emesik commented Jun 7, 2018

Sounds great, but still running pytest fails with unrecognized arguments: --cov=monero.

Got the same result in Python 2.7.15 and 3.6.5

@rooterkyberian
Copy link
Contributor Author

and you are sure you have run pip install -r requirements.txt -r test_requirements.txt ?

I had some syntax still messed up in readme, now it should properly render: https://github.com/rooterkyberian/monero-python/blob/ci/README.rst

@emesik emesik merged commit 12e69da into monero-ecosystem:master Jun 12, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants