From 6005f80f9b3c2553f81deef1a0396d0767f53959 Mon Sep 17 00:00:00 2001
From: gord chung <gord@live.ca>
Date: Mon, 11 Sep 2017 17:21:06 +0000
Subject: [PATCH] fix gate

new ostestr is different and is breaking gate. i don't think we
really need ostestr since we don't use it in any of the projects
under Telemetry. so to remain consistent and simple, just follow
similar pattern.

Change-Id: I742de2107cf56ef8b223fa1431529e706cc52377
---
 run-tests.sh        | 5 +++++
 tools/pretty_tox.sh | 4 ++--
 tox.ini             | 2 +-
 3 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/run-tests.sh b/run-tests.sh
index b0484761a..50198945f 100755
--- a/run-tests.sh
+++ b/run-tests.sh
@@ -1,5 +1,10 @@
 #!/bin/bash -x
 set -e
+
+export OS_TEST_PATH=aodh/tests/unit
+./tools/pretty_tox.sh $*
+
+export OS_TEST_PATH=aodh/tests/functional
 AODH_TEST_DRIVERS=${AODH_TEST_DRIVERS:-postgresql}
 for indexer in ${AODH_TEST_DRIVERS}
 do
diff --git a/tools/pretty_tox.sh b/tools/pretty_tox.sh
index b96dc3f24..5094f61e0 100755
--- a/tools/pretty_tox.sh
+++ b/tools/pretty_tox.sh
@@ -10,7 +10,7 @@ TESTRARGS=$*
 #
 # this work around exists until that is addressed
 if [[ "$TESTARGS" =~ "until-failure" ]]; then
-    ostestr --slowest $TESTRARGS
+    python setup.py testr --slowest --testr-args="$TESTRARGS"
 else
-    ostestr --no-pretty --slowest --subunit $TESTRARGS | subunit-trace -f
+    python setup.py testr --slowest --testr-args="--subunit $TESTRARGS" | subunit-trace -f
 fi
diff --git a/tox.ini b/tox.ini
index 05cea4fa5..844b73d17 100644
--- a/tox.ini
+++ b/tox.ini
@@ -17,7 +17,7 @@ setenv =
 deps = .[test,{env:AODH_TEST_DEPS}]
 passenv = OS_TEST_TIMEOUT OS_STDOUT_CAPTURE OS_STDERR_CAPTURE OS_LOG_CAPTURE AODH_TEST_DRIVERS
 commands =
-   {toxinidir}/run-tests.sh  --black-regex '^aodh\.tests\.tempest\..*$' {posargs}
+   {toxinidir}/run-tests.sh {posargs}
    {toxinidir}/run-functional-tests.sh "{posargs}"
    aodh-config-generator