6 To allow for automated selective testing on large scale continuous integration
7 systems, all tests must be marked with at least one of the following markers:
27 The markers corespond to the daemon subdirectories in FRR's source code and have
28 to be added to tests on a module level depending on which daemons are used
31 The goal is to have continuous integration systems scan code submissions, detect
32 changes to files in a daemons subdirectory and select only tests using that
33 daemon to run to shorten developers waiting times for test results and save test
34 infrastructure resources.
36 Newly written modules and code changes on tests, which do not contain any or
37 incorrect markers will be rejected by reviewers.
42 The Registration of new markers takes place in the file
43 ``tests/topotests/pytest.ini``:
47 # tests/topotests/pytest.ini
51 babeld: Tests that run against BABELD
52 bfdd: Tests that run against BFDD
54 vrrpd: Tests that run against VRRPD
57 Adding markers to tests
58 ^^^^^^^^^^^^^^^^^^^^^^^
59 Markers are added to a test by placing a global variable in the test module.
61 Adding a single marker:
68 # add after imports, before defining classes or functions:
69 pytestmark = pytest.mark.bfdd
73 def test_using_bfdd():
76 Adding multiple markers:
83 # add after imports, before defining classes or functions:
92 def test_using_bgpd_ospfd_ospf6d():
95 Selecting marked modules for testing
96 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
97 Selecting by a single marker:
103 Selecting by multiple markers:
107 pytest -v -m "isisd or ldpd or nhrpd"
112 The `online pytest documentation <https://docs.pytest.org/en/stable/example/markers.html>`_
113 provides further information and usage examples for pytest markers.