kytos / pathfinder

Kytos main path finder Network Application (NApp)
https://napps.kytos.io/kytos/pathfinder
MIT License
1 stars 21 forks source link

Create tags decorator to tests #54

Closed gleybersonandrade closed 4 years ago

gleybersonandrade commented 4 years ago

Today, all the tests are executed without distinction. This commit creates a tag to divide tests in type (unit, integration, e2e) and in size (small, medium, large, all). "Unit" and "all" are the standard parameters.

To set tags to a test function:

import pytest

@pytest.mark.medium
def test_function():
...

To run the tests:

 python setup.py ci --size=all --type=unit

The 'test' parameter uses the standard arguments and each function starts with small size argument by default.

By default, Pytest only runs tests inside folder defined in type argument (It isn't necessary to use the type argument in the tag decorator).

Directory hierarchy:

/tests/
... e2e/
... integration/
... unit/

Related https://github.com/kytos/kytos/issues/1041