write-sglang-test

Guide writing SGLang CI and unit tests with CustomTestCase and server fixtures.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/rayleizhu/sglang --skill write-sglang-test
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: write-sglang-test
Source: https://github.com/rayleizhu/sglang/tree/main/.claude/skills/write-sglang-test
Command: npx skills add https://github.com/rayleizhu/sglang --skill write-sglang-test

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides a comprehensive guide and template for writing robust Continuous Integration (CI) and Unit Tests (UT) for the SGLang project, ensuring code quality and feature stability.

Core Features & Use Cases

  • Standardized Test Structure: Enforces the use of CustomTestCase and proper test file placement.
  • Fixture Management: Guides on reusing server fixtures for efficient test setup and teardown.
  • Model Selection Strategy: Recommends appropriate models for different test scenarios (e.g., small models for general functionality, 8B models for performance).
  • CI Registration: Details how to register tests for execution within the CI pipeline using register_cuda_ci or register_amd_ci.
  • Use Case: When a new feature is added to SGLang, developers can use this guide to quickly write and integrate comprehensive tests that will automatically run in the CI pipeline, catching regressions early.

Quick Start

Use the write-sglang-test skill to generate a basic functional correctness test file for a new SGLang feature.

Frequently Asked Questions about write-sglang-test

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write unit tests for SGLang features?

To write SGLang unit tests, use the CustomTestCase base class for standardized structure and place test files in the proper test directories. This ensures maintainable testing practices within the SGLang development lifecycle.

How do I register SGLang tests in the CI pipeline?

Register SGLang tests in the CI pipeline using the register_cuda_ci or register_amd_ci functions. This integrates your tests for automatic execution, catching regressions early in the development process.

What models should I use for SGLang CI testing?

For SGLang CI testing, select small models for general functionality tests and 8B models for performance scenarios. This model selection strategy optimizes test efficiency and coverage across different test types.

How do I set up server fixtures for SGLang unit tests?

Set up SGLang unit tests by reusing server fixtures for efficient test setup and teardown. Proper fixture management ensures standardized and efficient testing practices when validating new SGLang features.

Why should I use CustomTestCase for SGLang development?

Using CustomTestCase for SGLang development enforces a standardized test structure and proper file placement. This addresses the need for maintainable and efficient testing practices within the SGLang project.

Can I run SGLang continuous integration tests on AMD GPUs?

Yes, you can run SGLang continuous integration tests on AMD GPUs by using the register_amd_ci function to register your tests for execution within the CI pipeline.