write-sglang-test

Generate SGLang unit and E2E tests with CustomTestCase and CI registration.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill helps teams write and register CI/UT tests for SGLang, ensuring tests are properly organized, reproducible, and integrated with CI pipelines.

Core Features & Use Cases

  • CustomTestCase guidance: Enforces the use of CustomTestCase instead of raw unittest.TestCase to ensure proper teardown and resource cleanup.
  • CI registration: Guides placing register_*_ci calls at module level to enable automatic CI discovery.
  • Server fixture guidance: Provides patterns for launching and tearing down server fixtures in tests.
  • Test layout: Describes standard directory structure under test/registered and where unit vs server-based tests live.
  • Templates & tips: Offers templates and best practices for test naming, mocks, and teardown safety.

Quick Start

Create a new test file under test/registered/unit/, import CustomTestCase, and call register_cpu_ci at module level.

Frequently Asked Questions about write-sglang-test

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

FAQPage Schema
How do I register SGLang unit tests for CI discovery?

To register SGLang CI tests, place register_*_ci function calls at the module level of your test file. This ensures automatic CI discovery and proper pipeline integration for unit and server-based tests.

What is the standard directory layout for SGLang test files?

The standard SGLang test layout organizes files under the test/registered directory. Unit tests and server-based tests are placed in specific subdirectories to maintain reproducible structure and streamline CI workflows.

Why should I use CustomTestCase instead of unittest.TestCase for SGLang tests?

You should use CustomTestCase instead of raw unittest.TestCase to ensure proper teardown and resource cleanup in SGLang tests. It provides robust patterns for managing server fixtures and preventing resource leaks.

How do I set up and tear down server fixtures in SGLang E2E tests?

Setting up server fixtures in SGLang E2E tests involves using CustomTestCase to launch and tear down server instances safely. The skill provides specific patterns for robust teardown to ensure reproducible testing.

Can I use this approach to write SGLang tests without existing CI workflows?

Yes, this approach guides CI workflow setup alongside test creation. It ensures tests are properly organized under test/registered categories and integrated with CI pipelines from the start, even without existing workflows.