From ce108f0edadcb0ff6ec11c83b93738dfc94c7654 Mon Sep 17 00:00:00 2001 From: Gage Hugo Date: Thu, 2 Nov 2017 13:49:04 -0500 Subject: [PATCH] Migrate to stestr This change migrates the testing suite from using ostestr and testr to using stester. Also cleaned up a missing space from tox.ini. Change-Id: I886401a1efce6cb617a4db7a90ec9454bbea1d71 --- .gitignore | 2 +- .stestr.conf | 4 ++++ .testr.conf | 7 ------- test-requirements.txt | 2 +- tox.ini | 15 ++++++++++----- 5 files changed, 16 insertions(+), 14 deletions(-) create mode 100644 .stestr.conf delete mode 100644 .testr.conf diff --git a/.gitignore b/.gitignore index cd15f92c..40996b39 100644 --- a/.gitignore +++ b/.gitignore @@ -7,7 +7,7 @@ venv* .eggs/ .idea/ .tox -.testrepository +.stestr build/* cover/* .coverage* diff --git a/.stestr.conf b/.stestr.conf new file mode 100644 index 00000000..64fe016a --- /dev/null +++ b/.stestr.conf @@ -0,0 +1,4 @@ +[DEFAULT] +test_path=${OS_TEST_PATH:-./tests/unit} +top_dir=./ +group_regex=.*(test_cert_setup) diff --git a/.testr.conf b/.testr.conf deleted file mode 100644 index 35d9ba43..00000000 --- a/.testr.conf +++ /dev/null @@ -1,7 +0,0 @@ -[DEFAULT] -test_command=OS_STDOUT_CAPTURE=${OS_STDOUT_CAPTURE:-1} \ - OS_STDERR_CAPTURE=${OS_STDERR_CAPTURE:-1} \ - OS_TEST_TIMEOUT=${OS_TEST_TIMEOUT:-60} \ - ${PYTHON:-python} -m subunit.run discover -t ./ ./tests $LISTOPT $IDOPTION -test_id_option=--load-list $IDFILE -test_list_option=--list diff --git a/test-requirements.txt b/test-requirements.txt index b126073f..1fe8d4e5 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -5,7 +5,7 @@ coverage!=4.4,>=4.0 # Apache-2.0 fixtures>=3.0.0 # Apache-2.0/BSD hacking!=0.13.0,<0.14,>=0.12.0 # Apache-2.0 mock>=2.0.0 # BSD -testrepository>=0.0.18 # Apache-2.0/BSD +stestr>=1.0.0 # Apache-2.0 testscenarios>=0.4 # Apache-2.0/BSD testtools>=1.4.0 # MIT oslotest>=1.10.0 # Apache-2.0 diff --git a/tox.ini b/tox.ini index 780c7d46..6f226251 100644 --- a/tox.ini +++ b/tox.ini @@ -10,13 +10,14 @@ setenv = VIRTUAL_ENV={envdir} BRANCH_NAME=master CLIENT_NAME=bandit - VIRTUAL_ENV={envdir} + VIRTUAL_ENV={envdir} deps = -r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt commands = - coverage erase - python setup.py testr --coverage --slowest --testr-args='{posargs}' - coverage report -m + find bandit -type f -name "*.pyc" -delete + stestr run {posargs} +whitelist_externals = + find passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY [testenv:debug] @@ -50,8 +51,12 @@ commands = bandit-baseline -r bandit -ll -ii [testenv:cover] deps = -r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt +setenv = + {[testenv]setenv} + PYTHON=coverage run --source bandit --parallel-mode commands = - python setup.py testr --coverage --testr-args='{posargs}' + coverage erase + stestr run '{posargs}' coverage report [testenv:openstack_coverage]