From 354cc14c5989358479d758a9eb52850b0d812391 Mon Sep 17 00:00:00 2001 From: Felipe Monteiro Date: Fri, 8 Jun 2018 16:31:03 -0400 Subject: [PATCH] Use stestr as the test runner for unit tests This patchset changes Armada to use stestr instead of pytest for running unit tests as it is the officially sanctioned test runner in OpenStack [0]. [0] https://openstack.nimeyo.com/119685/openstack-dev-recent-changes-in-testr-and-migrating-stestr Change-Id: I4f1320968990d9d9cc4d50cac0f2eecc3a0d331c --- test-requirements.txt | 2 -- tools/run-unit-tests.sh | 15 --------------- tox.ini | 9 +++++++-- 3 files changed, 7 insertions(+), 19 deletions(-) delete mode 100755 tools/run-unit-tests.sh diff --git a/test-requirements.txt b/test-requirements.txt index 569d223c..4f986afb 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -12,6 +12,4 @@ testtools>=2.3.0 # MIT os-testr>=1.0.0 # Apache-2.0 flake8>=3.3.0 mock -pytest==3.2.1 -pytest-mock responses>=0.8.1 diff --git a/tools/run-unit-tests.sh b/tools/run-unit-tests.sh deleted file mode 100755 index feab07f9..00000000 --- a/tools/run-unit-tests.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/env bash - -# Script for passing regex filtering of unit tests to py.test conditionally. -# Needed because tox currently doesn't support conditional logic like this. - -posargs=$@ -if [ ${#posargs} -ge 1 ]; then - py.test -vvv -s --ignore=hapi -k $1 -else - py.test -vvv -s --ignore=hapi -fi -TEST_STATUS=$? -set -e - -exit $TEST_STATUS diff --git a/tox.ini b/tox.ini index a936684a..5254fe90 100644 --- a/tox.ini +++ b/tox.ini @@ -18,8 +18,13 @@ whitelist_externals = rm commands = find . -type f -name "*.pyc" -delete - python -V - {toxinidir}/tools/run-unit-tests.sh {posargs} + rm -Rf .testrepository/times.dbm + +[testenv:py35] +commands = + {[testenv]commands} + stestr run {posargs} + stestr slowest [testenv:docs] deps = -r{toxinidir}/doc/requirements.txt