test: discover nested and yml scenarios in parity tests - #172
Open
juliosuas wants to merge 1 commit into
Open
Conversation
The CLI loader accepts .yaml/.yml at any depth, but the bundled-scenario parity tests only globbed */*.yaml. Point those tests at the same discovery helper so a nested or .yml scenario cannot silently skip schema validation. Fixes OWASP#169.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #169.
What changed
The CLI already discovers
.yamland.ymlfiles at any depth under a scenario directory. The bundled-scenario parity tests usedscenarios/*/*.yaml, so a valid.ymlfile or a nested path never reached either validator.Those tests now call
_discover_scenario_files(), the same helper the CLI uses.test_scenarios.pyand the passing-fixture pairing use the same discovery.Tests
test_bundled_scenario_paths_match_loader_contractcovering.yml, nested.yaml, and ignored non-scenario files.pytest tests/test_scenario_schema_sync.py tests/test_scenario_pass_fixtures.py tests/test_scenarios.py— 76 passed.AI assistance disclosure
OpenAI Codex / Cursor Grok assisted with locating the glob mismatch, drafting the patch, and writing the regression test. I reviewed the diff, ran the tests above, and confirmed the helper matches the CLI loader contract.
Restored after an accidental fork deletion. Same commits as #171.