Merge "docs: Add doc on testing"

This commit is contained in:
Zuul authored and Gerrit Code Review committed 2026-09-25 19:44:54 +00:00
commit 7cb0bd83a1
5 files changed
+73 -9

No files matched your search

+5
View File
@@ -0,0 +1,5 @@
==============
Contributing
==============
.. include:: ../../../CONTRIBUTING.rst
+13
View File
@@ -0,0 +1,13 @@
==========================
Contributing to OSProfiler
==========================
.. toctree::
contributing
testing
.. toctree::
:hidden:
modules/modules
+49
View File
@@ -0,0 +1,49 @@
=======
Testing
=======
OSProfiler provides both unit and functional tests.
Unit tests
----------
Unit tests require no external dependencies. They can be run via ``tox``.
For example:
.. code-block:: shell
tox -e py314
Functional tests
----------------
Functional tests require a running Redis and RabbitMQ instance. You can either
install and configure these via your package manager or use a container. For
example, to start these services via ``docker``:
.. code-block:: shell
docker run -d --name rabbitmq -p 5672:5672 rabbitmq:3
docker run -d --name redis -p 6379:6379 redis:8
Tests can then be run via ``tox``. For example:
.. code-block:: shell
tox -e functional-py314
Once done, you can stop and remove the containers:
.. code-block:: shell
docker stop rabbitmq && docker rm rabbitmq
docker stop redis && docker rm redis
Linters
-------
Linters can be run using the ``pep8`` tox target:
.. code-block:: shell
tox -e pep8
+1 -3
View File
@@ -15,10 +15,8 @@ reasons (for example in isolating cross-project performance issues).
user/index
.. toctree::
:hidden:
contributor/modules/modules
contributor/index
.. rubric:: Indices and tables
+5 -6
View File
@@ -2,12 +2,11 @@
Using OSProfiler
================
OSProfiler provides a tiny but powerful library that is used by
most (soon to be all) OpenStack projects and their python clients. It
provides functionality to generate 1 trace per request, that goes
through all involved services. This trace can then be extracted and used
to build a tree of calls which can be quite handy for a variety of
reasons (for example in isolating cross-project performance issues).
OSProfiler provides a tiny but powerful library that is used by most OpenStack
projects and their clients. It provides functionality to generate 1 trace per
request, that goes through all involved services. This trace can then be
extracted and used to build a tree of calls which can be quite handy for a
variety of reasons (for example in isolating cross-project performance issues).
.. toctree::
:maxdepth: 2