Repository navigation
refactor(e2e): clean up test infrastructure code quality and efficiency #686
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -110,22 +110,31 @@ def get_models_with_feature(feature: str) -> list[str]: | |
| ] | ||
|
|
||
|
|
||
| def _parse_tp_overrides() -> dict | None: | ||
| """Parse E2E_MODEL_TP_OVERRIDES env var once at import time.""" | ||
| raw = os.environ.get("E2E_MODEL_TP_OVERRIDES") | ||
| if raw: | ||
| try: | ||
| parsed = json.loads(raw) | ||
| if isinstance(parsed, dict): | ||
| return parsed | ||
| except json.JSONDecodeError: | ||
| pass | ||
| return None | ||
|
|
||
|
|
||
| _TP_OVERRIDES = _parse_tp_overrides() | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Caching Useful? React with 👍 / 👎. |
||
|
|
||
|
|
||
| def get_model_spec(model_id: str) -> dict: | ||
| """Get spec for a specific model, raising KeyError if not found.""" | ||
| if model_id not in MODEL_SPECS: | ||
| raise KeyError(f"Unknown model: {model_id}. Available: {list(MODEL_SPECS.keys())}") | ||
| spec = dict(MODEL_SPECS[model_id]) | ||
| tp_overrides_json = os.environ.get("E2E_MODEL_TP_OVERRIDES") | ||
| if tp_overrides_json: | ||
| try: | ||
| tp_overrides = json.loads(tp_overrides_json) | ||
| if isinstance(tp_overrides, dict): | ||
| override = tp_overrides.get(model_id) | ||
| if isinstance(override, int) and override > 0: | ||
| spec["tp"] = override | ||
| except json.JSONDecodeError: | ||
| # Ignore malformed override config and fall back to canonical specs. | ||
| pass | ||
| if _TP_OVERRIDES is not None: | ||
| override = _TP_OVERRIDES.get(model_id) | ||
| if isinstance(override, int) and override > 0: | ||
| spec["tp"] = override | ||
| return spec | ||
|
|
||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Switching
_get_marker()toresolve_class_marker()changes precedence when a test method has anengine/vendor/gpumarker but its class only inherits a parent class marker:resolve_class_marker()returns the inherited class marker before consultingitem.get_closest_marker(), so method-level overrides are ignored. UnderE2E_ENGINE/E2E_VENDOR/E2E_GPU_TIERfiltering this can incorrectly include/exclude tests in subclass hierarchies where only the parent class carries the broad marker.Useful? React with 👍 / 👎.