write-sglang-test

Create SGLang CI and unit tests using CustomTestCase and server fixtures.

31.6k|7.8k|Updated Jan 8, 2024
One-click install
npx skills add https://github.com/sgl-project/sglang --skill write-sglang-test-sgl-project
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: write-sglang-test
Source: https://github.com/sgl-project/sglang/tree/main/.claude/skills/write-sglang-test
Command: npx skills add https://github.com/sgl-project/sglang --skill write-sglang-test-sgl-project

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 specific directory structures (test/registered/).
  • Fixture Management: Guides on reusing server fixtures and launching SGLang servers for tests.
  • Model Selection Strategy: Recommends appropriate models for different test scenarios (e.g., small models for basic functionality, 8B for performance).
  • CI Registration: Details how to register tests for CI execution with estimated times and suite assignments.
  • Use Case: When a new feature is developed for SGLang, this Skill helps engineers write the necessary tests to verify its correctness and performance before merging into the main branch.

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 class and place files in the test/registered/ directory. This ensures your tests adhere to project conventions and are recognized by automated CI pipelines for execution.

How do I register a test for SGLang CI execution?

Registering a test for SGLang CI execution involves defining estimated execution times and assigning the test to specific CI suites. This configuration ensures automated pipelines schedule and execute your unit tests correctly.

What is the best way to select models for SGLang CI and unit tests?

Selecting models for SGLang tests depends on the scenario: use small models for basic functionality verification and 8B models for performance testing. This strategy balances test execution speed and comprehensive coverage.

How do I use server fixtures when testing SGLang?

Server fixtures in SGLang tests are utilized by reusing existing fixtures or launching new SGLang server instances within your test setup. This allows you to simulate server interactions and verify feature correctness reliably.

Does SGLang test automation require a specific directory structure?

Yes, SGLang test automation requires placing new test files within the test/registered/ directory structure. Adhering to this specific layout is necessary for the CI system to automatically discover and execute your test suites.

When do I need to write CI tests for SGLang?

You need to write SGLang CI tests when a new feature is developed to verify its correctness and performance before merging. This ensures code quality and feature stability are maintained within the main project branch.