Repository navigation
test: discover bundled scenarios against the loader's contract - #170
avp9-nexus wants to merge 1 commit into
Conversation
ossumpossum
left a comment
There was a problem hiding this comment.
LGTM. Verified against main: the loader accepts .yaml and .yml (src/agent_harness/scenario.py:66) while discovery was glob("*/*.yaml") (one level, one suffix), so a runnable scenario could sit outside the parity test's view. Matching discovery to the loader's contract (both suffixes, any depth) is the correct alignment.
The non-empty assertion is the important half: without it, an empty parametrization collects zero cases and the suite reports green while validating nothing. Good to have that guard in place.
Non-blocking follow-up (not needed to merge): consider adding a fixture that exercises the widened discovery directly, a .yml scenario and/or one nested an extra level, so a future regression in _bundled_scenario_paths() fails loudly rather than silently narrowing again. The assertion already covers the zero-collection case; a fixture would additionally prove the both-suffixes/any-depth behavior stays wired.
|
Thanks for the independent verification, and agreed on the follow-up. One note on form: the PR body documents that we demonstrated exactly this during testing, with two temporary probes (a .yml at the same depth, a .yaml one level deeper; discovery went 20→22, then the probes were removed). Making that permanent as a bundled fixture would put test scaffolding into the shipped scenario corpus, which feels wrong for a set that ships to users. The clean version is a unit test over a tmp_path scenarios dir asserting both suffixes and nested depth are discovered, next to the existing sync tests. Happy to add it to this PR if maintainers prefer it in one change, or as a follow-up once this lands. |
|
Good call, and I'll walk back the bundled-fixture suggestion. You're right that a real In-PR or as a follow-up both work for me; that's the maintainers' call. Approval stands either way. |
|
A note on the state of this PR rather than on its content: the workflow run was queued on 13 August, waited for maintainer approval, and expired after thirty days without ever running. None of its three jobs started, so there is no check result on the branch either way. Unlike a run that leaves a required check pending, this one leaves nothing behind: GitHub still reports the branch as What it changes, briefly. Whenever a maintainer has a minute, merging or approving a fresh run is enough. If it is easier to trigger one from your side, say so and I will rebase and push. Avp9. |
Fixes #169
Describe the changes you have made in this PR -
_bundled_scenario_paths()discovered*/*.yaml, one directory level and one extension. The loader accepts.yamland.yml(src/agent_harness/scenario.py:66), so a scenario the harness would happily run could sit outside the parity test's view.Two changes:
scenarios/.@pytest.mark.parametrize, where an empty list produces zero cases and a passing suite. A future directory move could therefore empty the parity control without any signal.Equivalent on the current tree. 20
.yaml, 0.yml, all at depth two. The parity test collects 20 cases before and 20 after, so nothing changes today.Demonstrated to catch what the old discovery missed. With two temporary scenarios added, one as
.ymlat the same depth and one as.yamlone level deeper, the old glob found 20 files and the new discovery found 22, and the parity test collected 22 cases instead of 20. Both temporary files were removed afterwards.Code Understanding and AI Usage
Did you use AI assistance (ChatGPT, Claude, Copilot, etc.) to write any part of this code or documentation ?
If you used AI assistance, briefly describe:
scenarios/, counted extensions and path depths, and readscenario.pyandtest_scenario_schema_sync.pydirectly to confirm both the loader contract and theparametrizeconsumptionruff check src tests;mypy; and a deliberate check that the new discovery finds files the old one missed, described aboveChecklist before requesting a review
[Unreleased]inCHANGELOG.md(or this PR does not need one — pure refactor, internal tests, or CI-only change)Test results, run locally on Python 3.13.15 in a clean virtual environment:
One caveat stated rather than glossed: CI pins Python 3.11 and no Windows installer is published for it any more, so the above was run on 3.13.15. The project requires
>=3.11, and CI will confirm on 3.11.The unticked box is the conditional one: this changes an existing test's discovery rather than adding a core feature, so no new tests are introduced.