write-sglang-test

Create and register SGLang CI/UT tests with CustomTestCase and CI functions.

Updated Apr 7, 2026
One-click install
npx skills add https://github.com/Nabilhassan12345/voice-ai-workspace --skill write-sglang-test-nabilhassan12345
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: write-sglang-test
Source: https://github.com/Nabilhassan12345/voice-ai-workspace/tree/main/sglang/.claude/skills/write-sglang-test
Command: npx skills add https://github.com/Nabilhassan12345/voice-ai-workspace --skill write-sglang-test-nabilhassan12345

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Writing consistent CI/UT tests for SGLang can be error-prone and inconsistent. This guide provides a standard approach to authoring tests, registering them for CI, and reusing server fixtures and mocks.

Core Features & Use Cases

  • Provides patterns for CustomTestCase usage to guarantee tearDownClass executes and resources are cleaned up.
  • Defines standard CI registration calls (register_cuda_ci, register_cpu_ci, etc.) and suite mapping to per-commit, nightly, or multi-backend tests.
  • Guides test placement under test/registered/<category>/ and server fixture reuse for reliable end-to-end tests.
  • Describes organization tips for unit tests, integration tests, and JIT kernel tests where applicable.

Quick Start

Create a new test by extending CustomTestCase, register it with the appropriate CI function, and place the file under test/registered/<category>/ so CI can discover and run it.

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 tests for automated execution?▼

To write SGLang CI tests, extend CustomTestCase, implement defensive tearDownClass for resource cleanup, and register the test using register_cuda_ci or register_cpu_ci based on target hardware. Place the file under test/registered/<category>/ for automated test discovery.

What is the standard directory structure for organizing SGLang unit and integration tests?▼

The standard directory structure for SGLang tests requires placing files under test/registered/<category>/ to ensure CI can discover and run them. This structure organizes unit tests, integration tests, and JIT kernel tests according to their CI suite mapping.

How do I ensure proper resource cleanup when running SGLang server fixtures?▼

Proper resource cleanup for SGLang server fixtures is ensured by extending CustomTestCase and implementing a defensive tearDownClass method. This standardized pattern guarantees that server instances and mocks are reliably destroyed after test execution.

Can I map SGLang test suites to different CI schedules like per-commit or nightly runs?▼

Yes, you can map SGLang test suites to per-commit, nightly, or multi-backend CI schedules. By utilizing the register_cuda_ci and register_cpu_ci registration calls, tests are categorized and routed to their appropriate automated execution pipelines.

What metadata format is required for SGLang tests to be discovered by CI?▼

SGLang tests require standard frontmatter containing name and description fields to be discovered by CI. This metadata, combined with proper placement under the test/registered/ directory, allows the automated system to identify and execute the test cases.