Files
sglang/test/README.md

33 lines
719 B
Markdown
Raw Normal View History

2024-08-03 23:09:21 -07:00
# Run Unit Tests
SGLang uses the built-in library [unittest](https://docs.python.org/3/library/unittest.html) as the testing framework.
2024-08-10 15:09:03 -07:00
## Test Backend Runtime
```bash
cd sglang/test/srt
2024-08-03 23:09:21 -07:00
# Run a single file
2024-08-10 15:09:03 -07:00
python3 test_srt_endpoint.py
2024-08-03 23:09:21 -07:00
2024-08-10 15:09:03 -07:00
# Run a single test
python3 -m unittest test_srt_endpoint.TestSRTEndpoint.test_simple_decode
# Run a suite with multiple files
2024-08-03 23:09:21 -07:00
python3 run_suite.py --suite minimal
```
2024-08-10 15:09:03 -07:00
## Test Frontend Language
```bash
cd sglang/test/lang
export OPENAI_API_KEY=sk-*****
2024-08-03 23:09:21 -07:00
# Run a single file
2024-08-10 15:09:03 -07:00
python3 test_openai_backend.py
# Run a single test
python3 -m unittest test_openai_backend.TestOpenAIBackend.test_few_shot_qa
2024-08-03 23:09:21 -07:00
2024-08-10 15:09:03 -07:00
# Run a suite with multiple files
2024-08-03 23:09:21 -07:00
python3 run_suite.py --suite minimal
```