Skip to content

Commit

Permalink
Address issue #4020
Browse files Browse the repository at this point in the history
  • Loading branch information
cbeauchesne committed Feb 10, 2025
1 parent d77b82f commit 887528b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
19 changes: 19 additions & 0 deletions tests/test_the_test/test_scenario_names.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import re
from utils import scenarios
from utils._context._scenarios import get_all_scenarios


@scenarios.test_the_test
def test_scenario_names():
for scenario in get_all_scenarios():
name = scenario.name
assert re.fullmatch(
r"^[A-Z][A-Z\d_]+$", name
), f"'{name}' is not a valid name for a scenario, it should be only capital letters"

expected_property = name.lower()

assert hasattr(scenarios, expected_property), f"Scenarios object sould have the {expected_property} property"
assert (
getattr(scenarios, expected_property) is scenario
), f"scenarios.{expected_property} should be the {scenario} object"
4 changes: 2 additions & 2 deletions utils/_context/_scenarios/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class _Scenarios:
profiling = ProfilingScenario("PROFILING")

appsec_no_stats = EndToEndScenario(
name = "APPSEC_NO_STATS",
name="APPSEC_NO_STATS",
doc=(
"End to end testing with default values. Default scenario has DD_TRACE_COMPUTE_STATS=true."
"This scenario let that env to use its default"
Expand Down Expand Up @@ -662,7 +662,7 @@ class _Scenarios:
scenario_groups=[ScenarioGroup.DEBUGGER],
)

fuzzer = DockerScenario("_FUZZER", doc="Fake scenario for fuzzing (launch without pytest)", github_workflow=None)
fuzzer = DockerScenario("FUZZER", doc="Fake scenario for fuzzing (launch without pytest)", github_workflow=None)

# Single Step Instrumentation scenarios (HOST and CONTAINER)

Expand Down

0 comments on commit 887528b

Please sign in to comment.