Skip to content

[serve] Improve test_root_path in test_fastapi.py - #60270

Merged
abrarsheikh merged 5 commits into
ray-project:masterfrom
axreldable:root_path_test
Jan 26, 2026
Merged

abrarsheikh merged 5 commits into
ray-project:masterfrom
axreldable:root_path_test

Conversation

@axreldable

Copy link
Copy Markdown
Contributor

Description

Update the test_root_path unit test in the test_fastapi.py.

The new implementation is more descriptive in the expected values of the request urls, ASGI scope["root_path"], and scope["path"] for different root_path configurations provided via the app and serve layers.

Related issues

Relates to the PR #57555

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

The pull request significantly improves the test_root_path unit test by introducing more descriptive expected values and a comprehensive set of test URLs. The updated test logic now correctly verifies both root_path and path from the ASGI scope for various app_root_path and serve_root_path configurations, including handling different uvicorn versions. The detailed docstring with the explanation table is a great addition for understanding the test's intent and expected behaviors.

Comment thread python/ray/serve/tests/test_fastapi.py Resolved
cursor[bot]

This comment was marked as outdated.

@ray-gardener ray-gardener Bot added serve Ray Serve Related Issue community-contribution Contributed by the community labels Jan 18, 2026
@abrarsheikh abrarsheikh added the go add ONLY when ready to merge, run all tests label Jan 19, 2026
Comment thread python/ray/serve/tests/test_fastapi.py Resolved
Comment thread python/ray/serve/tests/test_fastapi.py Resolved

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Comment thread python/ray/serve/tests/test_fastapi.py Resolved
@abrarsheikh
abrarsheikh merged commit a829bda into ray-project:master Jan 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community-contribution Contributed by the community go add ONLY when ready to merge, run all tests serve Ray Serve Related Issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants