[CI] tests: Retire test/srt and reject legacy test paths (#42567)

This commit is contained in:
Lianmin Zheng
2026-10-22 19:15:55 -07:00
committed by GitHub
parent e5dc0c363a
commit 5daa1352ba
5 changed files with 15 additions and 2 deletions
+6
View File
@@ -70,6 +70,12 @@ repos:
- '--extra-keys=metadata.kernelspec metadata.language_info.version' - '--extra-keys=metadata.kernelspec metadata.language_info.version'
- repo: local - repo: local
hooks: hooks:
- id: forbid-test-srt-path
name: forbid test/srt/ (use test/registered/ or test/manual/)
entry: >-
test/srt/ is retired. Move these tests under test/registered/ or test/manual/ instead.
language: fail
files: ^test/srt/
- id: forbid-docs-new-path - id: forbid-docs-new-path
name: forbid docs_new/ (renamed to docs/) name: forbid docs_new/ (renamed to docs/)
# docs_new/ was renamed to docs/ in #32123. `language: fail` fires only # docs_new/ was renamed to docs/ in #32123. `language: fail` fires only
+3
View File
@@ -15,6 +15,9 @@ The CI pipeline runs in three sequential stages: **A** (pre-flight, ~3 min) →
- `manual/`: Non-CI tests for local debugging or special setups. - `manual/`: Non-CI tests for local debugging or special setups.
- `run_suite.py`: CI runner — scans `registered/` recursively. - `run_suite.py`: CI runner — scans `registered/` recursively.
`test/srt/` is retired. Put CI tests under `registered/` and local-only tests
under `manual/`; lint rejects files in the retired directory.
The system supports both [unittest](https://docs.python.org/3/library/unittest.html) and [pytest](https://docs.pytest.org/en/stable/). The launcher runs `python filename.py -f` with **failfast enabled by default**. The system supports both [unittest](https://docs.python.org/3/library/unittest.html) and [pytest](https://docs.pytest.org/en/stable/). The launcher runs `python filename.py -f` with **failfast enabled by default**.
Make sure your file ends with **exactly** one of: Make sure your file ends with **exactly** one of:
@@ -11,7 +11,7 @@ constructing the full model or requiring a GPU:
- ``lm_head.weight`` kept as-is - ``lm_head.weight`` kept as-is
- ``*inv_freq`` entries skipped - ``*inv_freq`` entries skipped
Run: python3 test/srt/models/test_mamba2.py Run: python3 test/registered/unit/models/test_mamba2.py
""" """
import unittest import unittest
@@ -19,6 +19,10 @@ import unittest
import torch import torch
from sglang.srt.models.mamba2 import Mamba2ForCausalLM from sglang.srt.models.mamba2 import Mamba2ForCausalLM
from sglang.test.ci.ci_register import register_cpu_ci
from sglang.test.test_utils import CustomTestCase
register_cpu_ci(est_time=10, suite="base-a-test-cpu")
def _param(like: torch.Tensor) -> torch.nn.Parameter: def _param(like: torch.Tensor) -> torch.nn.Parameter:
@@ -41,7 +45,7 @@ class _FakeMamba2:
load_weights = Mamba2ForCausalLM.load_weights load_weights = Mamba2ForCausalLM.load_weights
class TestMamba2WeightRemap(unittest.TestCase): class TestMamba2WeightRemap(CustomTestCase):
def test_backbone_names_are_remapped_and_loaded(self): def test_backbone_names_are_remapped_and_loaded(self):
# SGLang-side parameters (load targets). # SGLang-side parameters (load targets).
sgl = { sgl = {