test(e2e): rename Gateway to ProxyClient and expose it as a pytest fixture - #33715
test(e2e): rename Gateway to ProxyClient and expose it as a pytest fixture#33715devin-ai-integration[bot] wants to merge 1 commit into
Conversation
…p unused grafana docs Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
|
|
Greptile SummaryThis PR is a purely mechanical harness refactor:
Confidence Score: 5/5This is a rename-and-fixture-wiring refactor of the e2e test harness; no production code is touched and behavior is unchanged. The rename is mechanically consistent across all 53 files — every client.gateway reference, import, and protocol property has been updated. The new session-scoped proxy fixture correctly eliminates per-suite build_gateway() duplication without altering lifecycle or cleanup semantics. The only rough edge is a single local variable in claude_code/conftest.py that changes type mid-function, which is a readability concern with no runtime impact. tests/e2e/claude_code/conftest.py — the proxy variable is reused for two different types in the same function scope.
|
| Filename | Overview |
|---|---|
| tests/e2e/proxy_client.py | New file: renamed from e2e_gateway.py; class renamed from Gateway to ProxyClient, build function from build_gateway to build_proxy_client. Content is otherwise identical. |
| tests/e2e/conftest.py | Adds the new session-scoped proxy fixture; updates resources fixture to use ProxyClientProvider/client.proxy. |
| tests/e2e/lifecycle.py | GatewayProvider → ProxyClientProvider, .gateway property → .proxy; import updated from e2e_gateway to proxy_client. |
| tests/e2e/claude_code/conftest.py | Renamed _build_control_gateway to use build_proxy_client; local variable proxy now reused for both ProxyConfig (from resolve_proxy) and ProxyClient (from _build_control_gateway), shadowing the type mid-function. |
| tests/e2e/router/conftest.py | Renamed Gateway → ProxyClient throughout; client fixture now takes proxy parameter; helper functions updated accordingly. |
| tests/e2e/quota_management/spend_tracking/conftest.py | client fixture now takes proxy parameter; driver_models fixture updated to use client.proxy instead of client.gateway. |
| tests/e2e/logging/logging_client.py | gateway attribute renamed to proxy; all self.gateway references updated to self.proxy; build_logging_client now accepts proxy parameter. |
| tests/e2e/management/management_client.py | gateway attribute renamed to proxy throughout; build_client now accepts proxy parameter. |
| tests/e2e/grafana/status_history_panels.md | Deleted dead-prose file not referenced anywhere in the test tree. |
Reviews (1): Last reviewed commit: "test(e2e): rename Gateway->ProxyClient, ..." | Re-trigger Greptile
| from requests import RequestException | ||
|
|
||
| gateway = _build_control_gateway(proxy) | ||
| proxy = _build_control_gateway(proxy) |
There was a problem hiding this comment.
The
proxy variable changes type mid-function: it starts as ProxyConfig (from resolve_proxy()) and is immediately overwritten with a ProxyClient. The original code avoided this by using a distinct name (gateway = _build_control_gateway(proxy)). Using a separate name keeps the two concepts explicit and avoids surprising readers (or a future type-narrowing pass) with a variable whose type silently changes.
| proxy = _build_control_gateway(proxy) | |
| proxy_client = _build_control_gateway(proxy) |
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Relevant issues
Linear ticket
Resolves LIT-4549
Pre-Submission checklist
Type
🧹 Refactoring
✅ Test
Changes
Two changes to the e2e harness, no product code touched.
Rename the misnamed shared proxy wrapper.
tests/e2e/e2e_gateway.pyheldGateway, which is not a gateway server; it is the client every suite uses to talk to the proxy (keys, models, chat/embed/ocr, spend read-backs, poll helpers). The file is nowproxy_client.pyand the class isProxyClient, withbuild_gatewaybecomingbuild_proxy_clientandGatewayProviderbecomingProxyClientProvider. The.gatewayattribute suites hold is now.proxy. Only identifiers changed; renaming was done token-by-token so strings and prose were left alone, then the docstrings/comments and the e2eCLAUDE.md/CONTRIBUTING.mdwere updated to match.Make it a pytest fixture. Previously each suite built its own instance through a per-suite
build_client()that calledbuild_gateway()inside, so the proxy wiring was duplicated across every suite. There is now one session-scopedproxyfixture intests/e2e/conftest.py:Each suite's
clientfixture depends on it and injects it, and each suite factory takes the client instead of constructing its own:Behavior is unchanged: shared transport, data-plane/control-plane split routing, poll budget, typed request/response models, and resource cleanup all go through the same object.
claude_code/keeps callingbuild_proxy_client(...)directly with its own base URLs (it has its own harness and does not use the shared fixtures).Also deletes
tests/e2e/grafana/status_history_panels.md, prose describing dashboards that nothing in the tree reads.QA runbook
No test behavior changed; this is a rename plus fixture-wiring refactor of the harness. Validation performed:
make lint-e2e-basedpyrightreports 0 errorsruff check tests/e2epassespytest --collect-onlyovertests/e2ecollects every suite with no import/fixture errorspython -m coverage_registry.collectorstill resolves everycovers(...)marker (152/384), confirming no marker regressed in the renameFinal Attestation
Link to Devin session: https://app.devin.ai/sessions/fdfd7afe0a954cb6851e76636d53237e
Requested by: @yassin-berriai