Skip to content

Conversation

key4ng
Copy link
Collaborator

@key4ng key4ng commented Oct 18, 2025

Motivation

The SGLang router supports gRPC connections but lacks end-to-end tests to validate this functionality. This PR adds comprehensive test coverage for gRPC endpoints to ensure reliability and catch regressions.

Modifications

  • Added 14 new test files under sgl-router/py_test/e2e_grpc/
    • Test categories:
      • Basic endpoints: /v1/models, /v1/chat/completions
      • Embedding functionality
      • Function calling with tool choice
      • Advanced features: cache reporting, EBNF grammar, hidden states
      • Edge case validation (e.g., large max_new_tokens)
    • Test structure: Organized into basic/, function_call/, features/, and validation/ subdirectories

Accuracy Tests

https://github.com/sgl-project/sglang/actions/runs/18694641875/job/53308814787?pr=11790

Benchmarking and Profiling

Checklist

@key4ng key4ng changed the title Good int [draft] grpc e2e test Oct 18, 2025
Copy link
Collaborator

@CatherineSue CatherineSue left a comment

Choose a reason for hiding this comment

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

Can we simplify this by verifying the /v1/models and /v1/chat/completions endpoint first?

I think for advanced features, we don't need cache_report, ebnf, hidden_states yet.

@key4ng key4ng changed the title [draft] grpc e2e test [router] Add gRPC E2E test suite Oct 21, 2025
@key4ng key4ng marked this pull request as ready for review October 21, 2025 17:43
assert len(response.choices[0].message.content) > 0


class TestReasoningContentWithoutParser(CustomTestCase):
Copy link
Collaborator

Choose a reason for hiding this comment

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

can we remove this test or rename it?

Because it is basically duplicated to test_nonstreaming_separate_reasoning_false above.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

sure removed

import requests

_TEST_DIR = Path(__file__).parent
sys.path.insert(0, str(_TEST_DIR.parent))
Copy link
Collaborator

Choose a reason for hiding this comment

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

why do we need this for all uts?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This adds the e2e_grpc directory to Python's module search path, allowing from util import ... to work

python3 -m pip --no-cache-dir install --upgrade --break-system-packages genai-bench==0.0.2
pytest -m e2e -s -vv -o log_cli=true --log-cli-level=INFO
- name: Run Python E2E gRPC tests
Copy link
Collaborator

Choose a reason for hiding this comment

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

shall we use another workflow?
to speed things up

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yeah good point. we can do that later once the openai router ci is also added

@slin1237 slin1237 enabled auto-merge (squash) October 22, 2025 00:51
@slin1237 slin1237 disabled auto-merge October 22, 2025 00:51
@slin1237 slin1237 merged commit 63cfe1b into sgl-project:main Oct 22, 2025
73 of 100 checks passed
xjpang pushed a commit to xjpang/sglang that referenced this pull request Oct 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants