From c3e6d6b54741cfbc828272ace576339ae3a37173 Mon Sep 17 00:00:00 2001 From: Aravinda VK Date: Wed, 17 Dec 2014 21:43:57 +0530 Subject: geo-rep: Unit tests infrastructure for geo-replication Added sample unit test file, $GLUSTER_SRC/geo-replication/tests/unit/test_syncdutils.py Install unittest dependencies, (tox https://tox.readthedocs.org/en/latest/, nose https://nose.readthedocs.org/en/latest/) sudo pip install --upgrade tox nose To run pep8 coding standards tests, cd $GLUSTER_SRC/geo-replication tox -e pep8 To run unit tests, cd $GLUSTER_SRC/geo-replication tox -e py27 py27 is for with Python 2.7+, or py26 for systems with Python 2.6+ Change-Id: Ibdefe2c9d73afda9a7fa1c0db5b126f592b7cb40 BUG: 1177722 Signed-off-by: Aravinda VK Reviewed-on: http://review.gluster.org/9290 Tested-by: Gluster Build System Reviewed-by: Prashanth Pai Reviewed-by: Vijay Bellur --- geo-replication/tox.ini | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 geo-replication/tox.ini (limited to 'geo-replication/tox.ini') diff --git a/geo-replication/tox.ini b/geo-replication/tox.ini new file mode 100644 index 00000000000..57ff086b947 --- /dev/null +++ b/geo-replication/tox.ini @@ -0,0 +1,32 @@ +[tox] +envlist = py26,py27,pep8 + +[testenv] +whitelist_externals=bash +setenv = VIRTUAL_ENV={envdir} +deps = + --download-cache={homedir}/.pipcache + -r{toxinidir}/test-requirements.txt +changedir = {toxinidir}/tests/unit +commands = nosetests -v --exe --with-xunit --with-coverage --cover-package syncdaemon --cover-erase --cover-xml --cover-html --cover-branches --with-html-output {posargs} + +[tox:jenkins] +downloadcache = ~/cache/pip + +[testenv:pep8] +changedir = {toxinidir} +commands = + flake8 + flake8 syncdaemon tests + +[testenv:cover] +setenv = NOSE_WITH_COVERAGE=1 + +[testenv:venv] +commands = {posargs} + +[flake8] +ignore = H +builtins = _ +exclude = .venv,.tox,dist,doc,tests,*egg +show-source = True \ No newline at end of file -- cgit