write-sglang-test

Create and register SGLang CI/UT tests using CustomTestCase templates.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill guides teams in writing and registering SGLang CI/UT tests, ensuring tests adopt a consistent structure, fixtures, and CI integration.

Core Features & Use Cases

  • Templates for CustomTestCase-based unit tests, including tearDown defenses to prevent resource leaks.
  • Clear guidance on server fixtures, test placement under test/registered, and CI registration using register_*_ci.
  • Reusable patterns for mocking, class-level setup, and teardown to ensure robust test suites.

Quick Start

Create a new unit test that uses CustomTestCase, calls a register_*_ci function at module level, and follows the test/registered/<category>/ layout.

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 and register SGLang CI/UT tests?▼

How to write SGLang CI/UT tests involves using CustomTestCase and calling register_*_ci at the module level. Tests must be organized under test/registered/<category>/ to ensure proper CI integration and consistent structure across unit, E2E, and server-based tests.

What is the standard structure for SGLang server-based tests?▼

The standard structure for SGLang server-based tests requires using CustomTestCase alongside server fixtures. It enforces a defensive setUpClass/tearDownClass pattern to prevent resource leaks and ensure robust test suite execution within your CI pipeline.

Does SGLang testing require a specific directory layout for CI integration?▼

Yes, SGLang testing requires a specific directory layout for CI integration. You must place your tests under the test/registered/<category>/ path to ensure the module-level register_*_ci calls are properly recognized by the continuous integration system.

Why do my SGLang unit tests leak resources during teardown?▼

SGLang unit tests leak resources during teardown when lacking proper defensive patterns. Using the CustomTestCase templates with defensive tearDownClass patterns prevents these leaks by ensuring robust class-level setup and teardown execution.