mirror of
https://pagure.io/fm-orchestrator.git
synced 2026-04-05 11:48:33 +08:00
Document integration test case and test environment design
Update the integration test README to explain the design of the test case and test environment code. This should help future contributors. Signed-off-by: Hunor Csomortáni <csomh@redhat.com>
This commit is contained in:
@@ -40,4 +40,26 @@ have 4 tests running in parallel one could call::
|
||||
|
||||
MBS_TEST_WORKERS=4 tox -e integration
|
||||
|
||||
Test case and test environment design
|
||||
=====================================
|
||||
|
||||
Currently each test case is implemented in a separate file.
|
||||
|
||||
Test cases interact with the test environment, test configuration, and service
|
||||
under test (SUT) through fixtures. These are defined in `conftest.py`_, and
|
||||
`pytest takes care`_ to create them.
|
||||
|
||||
These fixtures usually instantiate a class from `utils.py`_. These classes are
|
||||
intended to wrap the services or data the test cases need to interact with.
|
||||
This wrapping creates a layer of abstraction which makes the test cases more
|
||||
readable, and should also make updates easier, in case those services or data
|
||||
change in the future.
|
||||
|
||||
Test cases should check for preconditions (if any) in the test data and test
|
||||
environment. This helps to better understand test failures and debug failing
|
||||
test cases.
|
||||
|
||||
.. _tests/integration/example.test.env.yaml: example.test.env.yaml
|
||||
.. _conftest.py: conftest.py
|
||||
.. _pytest takes care: https://docs.pytest.org/en/latest/fixture.html#conftest-py-sharing-fixture-functions
|
||||
.. _utils.py: utils.py
|
||||
|
||||
Reference in New Issue
Block a user