Displays unit tests stats correcly.
[openstack-build/ceilometer-build.git] / xenial / debian / rules
index a3a99ccab6c553cfe308dfd106b04b582c714b37..a8b2bb685f4b93258fda35006af604a12940fb4e 100755 (executable)
@@ -11,6 +11,7 @@ export OSLO_PACKAGE_VERSION=$(VERSION)
 
 override_dh_clean:
        dh_clean
+       rm -rf .testrepository
        rm -rf ceilometer.egg-info
        rm -f debian/ceilometer-common.config debian/ceilometer-common.postinst debian/ceilometer-api.config debian/ceilometer-api.postinst
 
@@ -36,10 +37,12 @@ override_dh_auto_clean:
 
 override_dh_auto_test:
 ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS)))
-       set -e && TEMP_REZ=`mktemp -t` && \
-               bash -x ./setup-test-env.sh python setup.py testr --slowest  --testr-args='--subunit  --omit=test_bin.py  ' | tee $$TEMP_REZ | subunit2pyunit || true ; \
+       rm -rf .testrepository
+       testr init
+       set -e && \
+               TEMP_REZ=`mktemp -t` && \
+               bash -x ./setup-test-env.sh testr run --subunit 'tests\.(?!.*test_bin.*)' | subunit2pyunit || true ; \
                cat $$TEMP_REZ | subunit-filter -s --no-passthrough | subunit-stats || true ; \
-               rm -f $$TEMP_REZ
-       #./run-tests.sh || true
-       #PYTHONPATH=. nosetests -P || true
+               rm -f $$TEMP_REZ ;
+       testr slowest
 endif