diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 000000000..6718d9611 --- /dev/null +++ b/.coveragerc @@ -0,0 +1,6 @@ +[run] +branch = True +omit = /usr*,setup.py,*egg*,.venv/*,.tox/*,marconi/tests/* + +[report] +ignore-errors = True diff --git a/.testr.conf b/.testr.conf deleted file mode 100644 index 44f86a25c..000000000 --- a/.testr.conf +++ /dev/null @@ -1,4 +0,0 @@ -[DEFAULT] -test_command=python -m subunit.run discover . $LISTOPT $IDOPTION -test_id_option=--load-list $IDFILE -test_list_option=--list diff --git a/setup.py b/setup.py index c74beb512..768d9ca5d 100755 --- a/setup.py +++ b/setup.py @@ -17,14 +17,8 @@ from setuptools import setup, find_packages from marconi.openstack.common import setup as common_setup -install_requires = common_setup.parse_requirements(['tools/pip-requires']) -tests_require = common_setup.parse_requirements(['tools/test-requires']) -setup_require = common_setup.parse_requirements(['tools/setup-requires']) -dependency_links = common_setup.parse_dependency_links([ - 'tools/pip-requires', - 'tools/test-requires', - 'tools/setup-requires' -]) +requires = common_setup.parse_requirements() +dependency_links = common_setup.parse_dependency_links() setup( name='marconi', @@ -36,10 +30,7 @@ setup( packages=find_packages(exclude=['bin']), include_package_data=True, test_suite='nose.collector', - setup_requires=setup_require, - install_requires=install_requires, - tests_require=tests_require, - extras_require={'test': tests_require}, + install_requires=requires, dependency_links=dependency_links, cmdclass=common_setup.get_cmdclass(), ) diff --git a/tools/test-requires b/tools/test-requires index c5390fc63..40e50a422 100644 --- a/tools/test-requires +++ b/tools/test-requires @@ -6,3 +6,6 @@ pep8==1.3.3 python-subunit testrepository testtools +nose +nose-exclude +openstack.nose_plugin diff --git a/tox.ini b/tox.ini index 4a6f99b6b..213044795 100644 --- a/tox.ini +++ b/tox.ini @@ -2,19 +2,27 @@ envlist = py26,py27,pep8 [testenv] +setenv = VIRTUAL_ENV={envdir} + NOSE_WITH_OPENSTACK=1 + NOSE_OPENSTACK_COLOR=1 + NOSE_OPENSTACK_RED=0.05 + NOSE_OPENSTACK_YELLOW=0.025 + NOSE_OPENSTACK_SHOW_ELAPSED=1 + NOSE_OPENSTACK_STDOUT=1 deps = -r{toxinidir}/tools/pip-requires -r{toxinidir}/tools/test-requires -setenv = VIRTUAL_ENV={envdir} - OS_STDOUT_NOCAPTURE=False - OS_STDERR_NOCAPTURE=False - OS_LOG_NOCAPTURE=False -commands = bash -c 'if [ ! -d .testrepository ] ; then testr init ; fi' - bash -c 'testr run --parallel ; RET=$? ; echo "Slowest Tests" ; testr slowest && exit $RET' -sitepackages = True +commands = nosetests {posargs} -[testenv:cover] -commands = nosetests --no-path-adjustment --with-coverage --cover-erase --cover-package=marconi --cover-inclusive [] +[tox:jenkins] +downloadcache = ~/cache/pip [testenv:pep8] deps = pep8==1.3.3 -commands = pep8 --repeat --show-source --exclude=.venv,.tox,dist,doc,openstack . +commands = + pep8 --ignore=E125,E126,E711,E712 --repeat --show-source --exclude=.venv,.tox,dist,doc,openstack . + +[testenv:cover] +setenv = NOSE_WITH_COVERAGE=1 + +[testenv:venv] +commands = {posargs}