From f819fc8c24937bc54cf2eefb51b1a4bf343a7034 Mon Sep 17 00:00:00 2001
From: Tim Burke <tim.burke@gmail.com>
Date: Thu, 25 Mar 2021 13:06:24 -0700
Subject: [PATCH] Give functional tests another chance to pass

In the process, move from using os-testr to stestr.

Change-Id: Ib6651aab8b009605bf0855ec217003936c0fae6e
---
 .functests            | 4 ++--
 .stestr.conf          | 2 ++
 .testr.conf           | 4 ----
 lower-constraints.txt | 1 -
 py2-constraints.txt   | 1 -
 test-requirements.txt | 2 +-
 6 files changed, 5 insertions(+), 9 deletions(-)
 create mode 100644 .stestr.conf
 delete mode 100644 .testr.conf

diff --git a/.functests b/.functests
index 82638240b8..3d1af25b73 100755
--- a/.functests
+++ b/.functests
@@ -7,8 +7,8 @@ SRC_DIR=$(dirname $(realpath "$0"))
 
 cd ${SRC_DIR} > /dev/null
 export TESTS_DIR=${SRC_DIR}/test/functional
-ARGS="--concurrency 1 ${@:-"--pretty"}"
-ostestr $ARGS
+ARGS="run --concurrency 1 $@"
+stestr $ARGS || stestr run --concurrency 1 --failing
 rvalue=$?
 cd -  > /dev/null
 
diff --git a/.stestr.conf b/.stestr.conf
new file mode 100644
index 0000000000..3e674fb026
--- /dev/null
+++ b/.stestr.conf
@@ -0,0 +1,2 @@
+[DEFAULT]
+test_path=./test/functional
diff --git a/.testr.conf b/.testr.conf
deleted file mode 100644
index d5ddc32969..0000000000
--- a/.testr.conf
+++ /dev/null
@@ -1,4 +0,0 @@
-[DEFAULT]
-test_command=SWIFT_TEST_DEBUG_LOGS=${SWIFT_TEST_DEBUG_LOGS} ${PYTHON:-python} -m subunit.run discover -t ./ ${TESTS_DIR:-./test/functional/} $LISTOPT $IDOPTION
-test_id_option=--load-list $IDFILE
-test_list_option=--list
diff --git a/lower-constraints.txt b/lower-constraints.txt
index 4a98d3873a..75450ecfc5 100644
--- a/lower-constraints.txt
+++ b/lower-constraints.txt
@@ -43,7 +43,6 @@ netifaces==0.8
 nose==1.3.7
 nosehtmloutput==0.0.3
 nosexcover==1.0.10
-os-testr==0.8.0
 oslo.config==4.0.0
 oslo.i18n==3.20.0
 oslo.log==3.22.0
diff --git a/py2-constraints.txt b/py2-constraints.txt
index 694c9ce343..5a9318b602 100644
--- a/py2-constraints.txt
+++ b/py2-constraints.txt
@@ -52,7 +52,6 @@ openstackdocstheme===1.31.2
 stevedore===1.32.0
 botocore===1.15.39
 cmd2===0.8.9
-os-testr===1.1.0
 xattr===0.9.7
 six===1.14.0
 dulwich===0.19.15
diff --git a/test-requirements.txt b/test-requirements.txt
index 862a0e9219..529c71471f 100644
--- a/test-requirements.txt
+++ b/test-requirements.txt
@@ -8,7 +8,7 @@ coverage>=3.6 # Apache-2.0
 nose>=1.3.7 # LGPL
 nosexcover>=1.0.10 # BSD
 nosehtmloutput>=0.0.3 # Apache-2.0
-os-testr>=0.8.0 # Apache-2.0
+stestr>=2.0.0 # Apache-2.0
 mock>=2.0 # BSD
 python-swiftclient>=3.2.0
 python-keystoneclient!=2.1.0,>=2.0.0 # Apache-2.0