summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAde Lee <alee@redhat.com>2022-09-21 16:42:18 +0200
committerDouglas Mendizábal <dmendiza@redhat.com>2022-09-26 13:32:51 -0400
commitdc81852e95391af9be683fa66b0ad0580e792e3b (patch)
treeb9162deb57c25e63c2bbe56df3265a17d55572d0
parent771eb8640288bce0f4976d6c8481ccf27f94ced9 (diff)
downloadpython-barbicanclient-dc81852e95391af9be683fa66b0ad0580e792e3b.tar.gz
Make functional tests use stestr instead of nose
This moves in the direction that most projects have been moving and it works on python 3 too. Change-Id: I471f803c62722aa9935713921db27fca34282fb5
-rw-r--r--doc/source/contributor/testing.rst24
-rw-r--r--test-requirements.txt1
-rw-r--r--tox.ini2
3 files changed, 11 insertions, 16 deletions
diff --git a/doc/source/contributor/testing.rst b/doc/source/contributor/testing.rst
index d8a524b..7f2fd23 100644
--- a/doc/source/contributor/testing.rst
+++ b/doc/source/contributor/testing.rst
@@ -16,15 +16,17 @@ refer to the `tox documentation`_ for assistance.
Unit Tests
----------
-Currently, we provide tox environments for Python 2.7. By default
-all available test environments within the tox configuration will execute
+We follow the `Tested Runtimes <https://governance.openstack.org/tc/reference/project-testing-interface.html#tested-runtimes>`
+as defined by the Technical Committe every cycle.
+
+All available test environments within the tox configuration will execute
when calling ``tox``. If you want to run them independently, you can do so
with the following command:
.. code-block:: bash
- # Executes tests on Python 3.7
- tox -e py37
+ # Executes tests on Python 3.9
+ tox -e py39
.. note::
@@ -40,18 +42,18 @@ with the following command:
# runs a single test with the function named
# test_should_entity_str
- tox -e py37 -- test_should_entity_str
+ tox -e py39 -- test_should_entity_str
# runs only tests in the WhenTestingSecrets class and
# the WhenTestingOrderManager class
- tox -e p37 -- '(WhenTestingSecrets|WhenTestingOrderManager)'
+ tox -e p39 -- '(WhenTestingSecrets|WhenTestingOrderManager)'
The function name or class specified must be one located in the
`barbicanclient/tests` directory.
Groups of tests can also be run with a regex match after the ``--``.
- For more information on what can be done with ``testr``, please see:
- http://testrepository.readthedocs.org/en/latest/MANUAL.html
+ For more information on what can be done with ``stestr``, please see:
+ https://stestr.readthedocs.io/en/latest/
You can also setup breakpoints in the unit tests. This can be done by
adding ``import pdb; pdb.set_trace()`` to the line of the unit test you
@@ -59,7 +61,6 @@ want to examine, then running the following command:
.. code-block:: bash
- # Executes tests on Python 2.7
tox -e debug
.. note::
@@ -124,11 +125,6 @@ the functional tests through tox.
# Execute Barbican Functional Tests
tox -e functional
-
-By default, the functional tox job will use nosetests to execute the functional
-tests. This is primarily due to nose being a very well known and common
-workflow among developers.
-
.. note::
In order to run individual functional test functions, you must use the
diff --git a/test-requirements.txt b/test-requirements.txt
index d0c96f1..8f24b71 100644
--- a/test-requirements.txt
+++ b/test-requirements.txt
@@ -9,7 +9,6 @@ requests-mock>=1.2.0 # Apache-2.0
stestr>=2.0.0 # Apache-2.0
testtools>=2.2.0 # MIT
oslotest>=3.2.0 # Apache-2.0
-nose>=1.3.7 # LGPL
oslo.config>=5.2.0 # Apache-2.0
python-openstackclient>=3.12.0 # Apache-2.0
sphinxcontrib-svg2pdfconverter>=0.1.0 # BSD
diff --git a/tox.ini b/tox.ini
index 0182901..6e7411a 100644
--- a/tox.ini
+++ b/tox.ini
@@ -60,7 +60,7 @@ commands =
# This tox env is purely to make local test development easier
# Note: This requires local running instances of Barbican
deps = {[testenv]deps}
-commands = nosetests {toxinidir}/functionaltests/{posargs} -v
+commands = stestr run --serial --slowest --test-path {toxinidir}/functionaltests {posargs}
[flake8]
ignore = H202,W504