Hashar has uploaded a new change for review.
https://gerrit.wikimedia.org/r/221087
Change subject: Setup tox for easy venv
......................................................................
Setup tox for easy venv
Skip sdist, there is no need for it.
Instruct pip install to use an editable package when setting up the
venv (usedevelop = True)
Switch test runner to use nosetests discovery mecanism.
Add tests dependencies (mock, nose)
Basic README to help running the tests locally.
The default venv runs 'python setup.py test', one can pass extra
arguments as:
tox -e py27 -- --test-suite conftool.tests.unit
Change-Id: Ie87e3634eb0680a6ca4a35601e61dc631315b006
---
M .gitignore
A README
M setup.py
A tox.ini
4 files changed, 47 insertions(+), 1 deletion(-)
git pull ssh://gerrit.wikimedia.org:29418/operations/software/conftool
refs/changes/87/221087/1
diff --git a/.gitignore b/.gitignore
index 0d20b64..56a5633 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,5 @@
+/.eggs
+/.tox
+/*.egg-info
*.pyc
+*.swp
diff --git a/README b/README
new file mode 100644
index 0000000..b7b25fe
--- /dev/null
+++ b/README
@@ -0,0 +1,26 @@
+Wikimedia etcd conftool
+=======================
+
+Installation
+------------
+
+ python setup.py install
+
+Running tests
+-------------
+
+To run the integration tests, you will need to install `etcd` on your machine.
+
+We use the `tox` utility, a wrapper around virtualenv. To list available
+environements:
+
+ tox -l
+
+To run one:
+
+ tox -e flake8
+
+You can pass extra arguments to the underlying command, for example to only run
+the unit tests:
+
+ tox -e py27 -- --test-suite conftool.tests.unit
diff --git a/setup.py b/setup.py
index 033ba41..d80e88d 100755
--- a/setup.py
+++ b/setup.py
@@ -10,7 +10,8 @@
author_email='[email protected]',
url='https://github.com/wikimedia/operations-software-conftool',
install_requires=['python-etcd', 'pyyaml'],
- setup_requires=[],
+ test_suite='nose.collector',
+ tests_require=['mock', 'nose'],
zip_safe=True,
packages=find_packages(),
entry_points={
diff --git a/tox.ini b/tox.ini
new file mode 100644
index 0000000..ef9141d
--- /dev/null
+++ b/tox.ini
@@ -0,0 +1,15 @@
+[tox]
+minversion = 1.6
+skipsdist = True
+envlist = flake8, py27, py34
+
+[testenv]
+usedevelop = True
+commands = python setup.py test {posargs}
+
+[testenv:venv]
+commands = {posargs}
+
+[testenv:flake8]
+commands = flake8 {posargs}
+deps = flake8
--
To view, visit https://gerrit.wikimedia.org/r/221087
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie87e3634eb0680a6ca4a35601e61dc631315b006
Gerrit-PatchSet: 1
Gerrit-Project: operations/software/conftool
Gerrit-Branch: master
Gerrit-Owner: Hashar <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits