Repository navigation
Fix --models flag being silently ignored by e2e golden tests - #217
Merged
Merged
Conversation
|
The author of this PR, tadani3, is not an activated member of this organization on Codecov. |
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes the --models pytest selection flag so it correctly filters the e2e golden tests (which are parametrized by a case object rather than a model_type parameter).
Changes:
- Extend
pytest_collection_modifyitemsto readcase.model_typefor golden-test items and skip non-selected models. - Add
model_typeto the golden test case schema and toGoldenTestCase/load_test_case(). - Populate
model_typein all golden YAML case files so the selection mechanism can work deterministically at collection time.
Reviewed changes
Copilot reviewed 217 out of 217 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
tests/conftest.py |
Updates --models filtering to also handle golden tests via case.model_type. |
src/mobius/_testing/golden.py |
Adds model_type to GoldenTestCase and makes it a required YAML field in load_test_case(). |
testdata/cases/schema.json |
Makes model_type required in the JSON schema and documents its intent. |
testdata/cases/**/*.yaml |
Adds model_type to each case so golden tests can be filtered by --models. |
Comments suppressed due to low confidence (1)
src/mobius/_testing/golden.py:214
load_test_case()now requiresmodel_type, but the unit tests insrc/mobius/_testing/golden_test.pystill build YAML strings (e.g.MINIMAL_YAML,VL_YAML,SKIP_YAML) without amodel_typefield. With this change, those tests will raiseValueError: Missing required fieldsand fail. Update the test YAML fixtures to include a validmodel_typevalue for each case (and add assertions forcase.model_typewhere appropriate).
# Validate required top-level fields
_required = ("model_id", "model_type", "revision", "task_type", "dtype", "level")
missing = [k for k in _required if k not in data]
if missing:
raise ValueError(f"Missing required fields in {yaml_path}: {missing}")
justinchuby
approved these changes
May 1, 2026
Performance Comparison
|
…ed models detection for pushes to main
tadani3
enabled auto-merge (squash)
May 7, 2026 22:31
added 3 commits
May 7, 2026 23:27
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.
Problem
The
--modelsflag passed from CI workflows (gpu_l4_golden_parity.yml,gpu_l5_generation_e2e.yml) was silently ignored by the e2e golden tests. All ~214 golden tests ran every time, regardless of which models were actually affected.Root cause: The
pytest_collection_modifyitemshook intests/conftest.pyfilters tests by checking for amodel_typeparameter initem.callspec.params. But golden tests are parametrized with acaseobject (GoldenTestCase), notmodel_type. The hook hitcontinueand skipped filtering entirely.Fix
Added an explicit
model_typefield to the golden test YAML schema and wired it through to the filtering hook.Changes:
testdata/cases/schema.jsonmodel_typetorequiredandpropertiessrc/mobius/_testing/golden.pymodel_type: strfield toGoldenTestCase, extracted inload_test_case()tests/conftest.py--modelshook to checkcase.model_typefor golden test itemstestdata/cases/**/*.yaml(214 files)model_typeline to each YAML case fileWhy this approach
model_typeis a static YAML field — no reverse-map lookups, no registry imports in test infra, no network calls at collection time.model_typecauses a schema validation error (yaml_schema_test.py) and aload_test_case()ValueError. New YAML cases can't silently bypass the filter.model_id,task_type,dtype— already-required fields in the schema.Verification
pytest tests/yaml_schema_test.py--models qwen2--models nonexistent--models llamaonbuild_graph_test.py