Fix again unit tests.
[openstack-build/ceilometer-build.git] / xenial / debian / rules
index 60bf97e9e60a0b753ddeb0716a4781f690057676..a7c8a708e5c991b7549cca01f5689af7770cc23e 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
 
@@ -34,9 +35,11 @@ override_dh_auto_clean:
        rm -rf debian/ceilometer-common.postinst
        find . -iname '*.pyc' -delete
 
-ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS)))
 override_dh_auto_test:
-       bash -x ./setup-test-env.sh python setup.py testr --slowest || true
-       #./run-tests.sh || true
-       #PYTHONPATH=. nosetests -P || true
+ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS)))
+       rm -rf .testrepository
+       testr init
+       bash -x ./setup-test-env.sh testr run --subunit 'tests\.(?!.*test_bin.*)' | subunit2pyunit || true
+       testr slowest
+       testr last --subunit | subunit-filter -s --no-passthrough | subunit-stats
 endif