write-sglang-test

Guide contributors in creating SGLang CI and unit tests with proper fixtures and registration.

556|81|Updated May 19, 2026
One-click install
npx skills add https://github.com/FutureMLS-Lab/OSCAR --skill write-sglang-test-futuremls-lab
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: write-sglang-test
Source: https://github.com/FutureMLS-Lab/OSCAR/tree/main/sglang-research/.claude/skills/write-sglang-test
Command: npx skills add https://github.com/FutureMLS-Lab/OSCAR --skill write-sglang-test-futuremls-lab

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill prevents common SGLang testing mistakes by guiding contributors through test design, fixture management, CI registration, model selection, placement, and cleanup.

Core Features & Use Cases

  • Test Structure: Create unit, integration, server-based, kernel, benchmark, and evaluation tests using the appropriate SGLang conventions.
  • CI Integration: Select suitable CPU, CUDA, AMD, NPU, per-commit, or nightly suites and register tests with realistic runtime estimates.
  • Reliable Fixtures: Use CustomTestCase, standard server fixtures, defensive teardown, mock dependencies, and appropriate test models.
  • Use Case: When adding a new SGLang server feature, use this Skill to determine whether it needs a mocked unit test or a real-server test, select its directory and CI suite, and produce a correctly registered test.

Quick Start

Ask the write-sglang-test skill to create a CI-ready test for the specified SGLang feature using the lightest appropriate fixture, model, test location, and suite.

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 reliable SGLang unit tests for CI pipelines?

Reliable SGLang unit tests require CustomTestCase, appropriate mocked dependencies, and defensive teardown to ensure correct CI execution across CPU, CUDA, AMD, and NPU environments.

When do I need a server integration test vs a mocked unit test for SGLang?

Server integration tests use standard server fixtures for real-server interactions, while mocked unit tests isolate logic validation. Use standard server fixtures for integration and mocks for lightweight unit tests.

How do I register SGLang tests in CI with correct runtime estimates?

Registering SGLang tests in CI requires valid test placement and literal CI registration metadata with realistic runtime estimates to select suitable CPU, CUDA, per-commit, or nightly suites.

Does SGLang testing support AMD and NPU environments?

Yes, SGLang testing supports AMD and NPU environments. You can register tests by selecting the appropriate CI suite and applying correct fixtures for these specific hardware targets.

What is the best way to structure JIT kernel correctness tests for SGLang?

The best way to structure JIT kernel correctness tests is using CustomTestCase conventions with appropriate test models, placing them in valid directories, and registering them in the correct CI suite.

Why do my SGLang server integration tests fail during resource cleanup?

SGLang server integration tests often fail due to improper teardown. You must use defensive resource cleanup within CustomTestCase to prevent resource leaks and ensure reliable CI execution.