Refactor Tobiko test run guide

So far, the Tobiko docs were duplicated in some places, different
(although duplicated), and some fragments were not relevant (or
outdated).

This patch refactors the Tobiko test cases run guide by modularizing
the fragments ("spilling" fragments instead of coping them),
correcting typos, and deleting/updating irrelevant information.

Note: in order to see how the change will appear, download it with
`git review -d <change_url>`, run the `tox -e docs` command, and then
double click
(with the file explorer) tobiko/doc/build/html/<file-you-want>.

Change-Id: I4c8ba2cb89075ef25afd77fedeaed8a896df74e7
This commit is contained in:
Omer 2022-01-20 16:06:32 +01:00
parent 6a5c39c257
commit 87999de932
2 changed files with 70 additions and 10 deletions

View File

@ -0,0 +1,30 @@
In the first terminal, execute some Tobiko test cases as below:
To run test cases you need a test runner able to execute Python test cases.
Test cases delivered with Tobiko has been tested using
`stestr <https://stestr.readthedocs.io/en/latest/>`__
From the Tobiko source folder you can run scenario test cases using the below command::
pytest tobiko/tests/scenario/
You could also use tox to run test cases::
tox -e <environment_variable> -- path/to/test/module
For example::
tox -e scenario -- tobiko/tests/scenario/neutron/test_router.py
Note that with tox, the <environment_variable> should match the directory where
the test is (if the test is inside the 'scenario' directory, the environment
variable has to be scenario).
You can also run only a class of test cases by running::
tox -e <tox-env-list> -- path/to/test/module::class
You can run only a specific test case (a method) by running::
tox -e <tox-env-list> -- path/to/test/module::class::test_case

View File

@ -4,7 +4,7 @@
Tobiko Test Cases Execution Guide
=================================
This document describes how to execute Tobiko scenario test cases.
This document describes how to execute Tobiko test cases.
.. sidebar:: See also
@ -18,22 +18,52 @@ This document describes how to execute Tobiko scenario test cases.
Prepare Your System
~~~~~~~~~~~~~~~~~~~
-------------------
Before running Tobiko test cases, you need to be sure you are doing it from
Tobiko source files folder and that you have activated a virtualenv where Tobiko
and its requirements are installed. Please refer to
is, and its requirements are installed. Please refer to
:ref:`tobiko-installation-guide` and :ref:`tobiko-configuration-guide` to know
how to setup your system before running test cases.
Prepare some logging (Optional and recommended)
------------------------------------------------
To see if we are now being able to execute Tobiko test cases, please open
**a new terminal** and keep it open, where you could watch tobiko.log receive
logs on real time. Change directory to reach the directory where tobiko.log
file is and run the following command::
tail -F tobiko.log
.. _run-tobiko-test-cases:
Run Tobiko Test Cases
---------------------
.. run-tobiko-test-cases_label
Run Tobiko specific test cases
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. include:: _run_specific_tests.rst
Run Scenario Test Cases
~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. include:: _run_scenario.rst
Running Disruptive Test Cases
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. include:: _run_faults.rst
Run the Tobiko Workflow
~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. include:: _run_workflow.rst
Test Cases Report Files
~~~~~~~~~~~~~~~~~~~~~~~
To run test cases you need a test runner able to execute Python test cases.
Test cases delivered with Tobiko has been tested using
`stestr <https://stestr.readthedocs.io/en/latest/>`__
From the Tobiko source folder you can run scenario test cases using the below command::
stestr run --test-path tobiko/tests/scenario/
.. include:: _test_cases_report_files.rst