Skip to content

Commit d7bd34a

Browse files
committed
fix: add a special * tag that is always executed
1 parent 53ee2b1 commit d7bd34a

File tree

6 files changed

+16
-7
lines changed

6 files changed

+16
-7
lines changed

doc/changelog.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
Changelog
22
=========
33

4+
[0.2.2] - Unreleased
5+
--------------------
6+
7+
Fixed
8+
^^^^^
9+
- Discovery checkers are always executed, even with tag filtering.
10+
411
[0.2.1] - 2025-08-13
512
--------------------
613

scim2_tester/checkers/resource_types.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ def resource_types_schema_validation(
125125
return results
126126

127127

128-
@checker("discovery", "resource-types")
128+
@checker("*", "discovery", "resource-types")
129129
def query_all_resource_types(context: CheckContext) -> list[CheckResult]:
130130
"""Validate retrieval of all available resource types.
131131

scim2_tester/checkers/schemas.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def _schemas_endpoint(context: CheckContext) -> list[CheckResult]:
4444
return results
4545

4646

47-
@checker("discovery", "schemas")
47+
@checker("*", "discovery", "schemas")
4848
def query_all_schemas(context: CheckContext) -> list[CheckResult]:
4949
"""Validate retrieval of all available schemas.
5050

scim2_tester/checkers/service_provider_config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from ._discovery_utils import _test_discovery_endpoint_methods
88

99

10-
@checker("discovery", "service-provider-config")
10+
@checker("*", "discovery", "service-provider-config")
1111
def service_provider_config_endpoint(
1212
context: CheckContext,
1313
) -> list[CheckResult]:

scim2_tester/discovery.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ def get_all_available_tags() -> list[str]:
1616

1717
registered_tags = sorted(get_registered_tags())
1818

19+
registered_tags = [tag for tag in registered_tags if tag != "*"]
20+
1921
return registered_tags
2022

2123

scim2_tester/utils.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,18 +37,19 @@ def _matches_hierarchical_tags(func_tags: set[str], filter_tags: set[str]) -> bo
3737
Supports patterns like:
3838
- "crud" matches "crud:read", "crud:create", etc.
3939
- "crud:read" matches exactly "crud:read"
40+
- "*" matches any function with tags (always executed)
4041
4142
:param func_tags: Tags on the function
4243
:param filter_tags: Tags to filter by
4344
:returns: True if there's a match
4445
"""
46+
if "*" in func_tags:
47+
return True
48+
4549
for filter_tag in filter_tags:
4650
for func_tag in func_tags:
47-
# Exact match
4851
if filter_tag == func_tag:
4952
return True
50-
51-
# Hierarchical match: filter "crud" matches func "crud:read"
5253
if ":" in func_tag and filter_tag in func_tag.split(":"):
5354
return True
5455

@@ -232,7 +233,6 @@ def decorator(func: Any) -> Any:
232233
def wrapped(context: CheckContext, *args: Any, **kwargs: Any) -> Any:
233234
func_tags = set(tags) if tags else set()
234235

235-
# Check if function should be skipped based on tag filtering
236236
if context.conf.include_tags and not _matches_hierarchical_tags(
237237
func_tags, context.conf.include_tags
238238
):

0 commit comments

Comments
 (0)