Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so now no security test will run in CI? this would disable a couple tests

12 changes: 12 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,17 @@
sys.path.append(os.path.join(os.path.dirname(__file__), os.path.pardir))


def pytest_collection_modifyitems(session, config, items):
# This hook receives all items collected in session (not only from directory conftest is located
# in). Additional path-based filtering is needed.

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