From: Thomas Goirand Date: Wed, 18 Mar 2015 22:15:24 +0000 (+0100) Subject: Enables unit tests. X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=630f9375f7b61faf13fc6f9ba393c78004bf5997;p=openstack-build%2Fneutron-lbaas-build.git Enables unit tests. Rewritten-From: c4581f0dccf52a6bc5af62d61cb64c71b3d72046 --- diff --git a/xenial/debian/rules b/xenial/debian/rules index 5f6b700..d2ed0f7 100755 --- a/xenial/debian/rules +++ b/xenial/debian/rules @@ -14,23 +14,21 @@ override_dh_install: dh_install -O--buildsystem=python_distutils install -D -m 0644 etc/neutron_lbaas.conf $(CURDIR)/debian/neutron-lbass/etc/neutron/neutron_lbaas.conf -# Unit tests are disabled, because it expects neutron.conf -# in /usr/lib/python2.7/dist-packages/etc/neutron.conf -#override_dh_auto_test: -#ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS))) -# @echo "===> Running tests" -# set -e ; set -x ; for i in 2.7 ; do \ -# PYMAJOR=`echo $$i | cut -d'.' -f1` ; \ -# echo "===> Testing with python$$i (python$$PYMAJOR)" ; \ -# rm -rf .testrepository ; \ -# testr-python$$PYMAJOR init ; \ -# TEMP_REZ=`mktemp -t` ; \ -# PYTHONPATH=$(CURDIR) PYTHON=python$$i testr-python$$PYMAJOR run --subunit neutron_lbaas.tests.unit | tee $$TEMP_REZ | subunit2pyunit ; \ -# cat $$TEMP_REZ | subunit-filter -s --no-passthrough | subunit-stats ; \ -# rm -f $$TEMP_REZ ; \ -# testr-python$$PYMAJOR slowest ; \ -# done -#endif +override_dh_auto_test: +ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS))) + @echo "===> Running tests" + set -e ; set -x ; for i in 2.7 ; do \ + PYMAJOR=`echo $$i | cut -d'.' -f1` ; \ + echo "===> Testing with python$$i (python$$PYMAJOR)" ; \ + rm -rf .testrepository ; \ + testr-python$$PYMAJOR init ; \ + TEMP_REZ=`mktemp -t` ; \ + PYTHONPATH=$(CURDIR) PYTHON=python$$i testr-python$$PYMAJOR run --subunit neutron_lbaas.tests.unit | tee $$TEMP_REZ | subunit2pyunit ; \ + cat $$TEMP_REZ | subunit-filter -s --no-passthrough | subunit-stats ; \ + rm -f $$TEMP_REZ ; \ + testr-python$$PYMAJOR slowest ; \ + done +endif override_dh_auto_clean: dh_auto_clean