Skip to content

Commit

Permalink
Mark all tests in security directory as security
Browse files Browse the repository at this point in the history
Signed-off-by: Jan Musial <[email protected]>
  • Loading branch information
Jan Musial committed Mar 18, 2022
1 parent 4690cd6 commit 82ca8b0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/functional/pytest.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[pytest]
markers =
security: security objectives coverage
security: security objectives coverage, do not run by default
long: long, do not run by default
addopts = --ignore=tests/security -m "not long"
addopts = -m "not long and not security"
9 changes: 9 additions & 0 deletions tests/functional/tests/security/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
c_uint16,
c_int
)
from pathlib import Path
from tests.utils.random import RandomStringGenerator, RandomGenerator, DefaultRanges, Range

from pyocf.types.cache import CacheMode, MetadataLayout, PromotionPolicy
Expand All @@ -21,6 +22,14 @@
sys.path.append(os.path.join(os.path.dirname(__file__), os.path.pardir))


def pytest_collection_modifyitems(session, config, items):
base_dir = Path(config.rootdir)
for item in items:
rel_path = Path(item.fspath).relative_to(base_dir)
if rel_path.match("*/security/*"):
item.add_marker(pytest.mark.security)


def enum_min(enum):
return list(enum)[0].value

Expand Down

0 comments on commit 82ca8b0

Please sign in to comment.