[misc] Remove unit test cases that fail the admission criteria (round 2) (#30703)
This commit is contained in:
@@ -15,11 +15,6 @@ register_cpu_ci(1.0, "base-a-test-cpu")
|
||||
|
||||
|
||||
class TestAuthDecision(CustomTestCase):
|
||||
def test_allowed_default(self):
|
||||
decision = AuthDecision(allowed=True)
|
||||
self.assertTrue(decision.allowed)
|
||||
self.assertEqual(decision.error_status_code, 401)
|
||||
|
||||
def test_not_allowed_with_custom_status(self):
|
||||
decision = AuthDecision(allowed=False, error_status_code=403)
|
||||
self.assertFalse(decision.allowed)
|
||||
@@ -32,11 +27,6 @@ class TestAuthDecision(CustomTestCase):
|
||||
|
||||
|
||||
class TestAuthLevel(CustomTestCase):
|
||||
def test_enum_values(self):
|
||||
self.assertEqual(AuthLevel.NORMAL.value, "normal")
|
||||
self.assertEqual(AuthLevel.ADMIN_OPTIONAL.value, "admin_optional")
|
||||
self.assertEqual(AuthLevel.ADMIN_FORCE.value, "admin_force")
|
||||
|
||||
def test_is_string_enum(self):
|
||||
self.assertIsInstance(AuthLevel.NORMAL, str)
|
||||
# str mixin allows direct comparison with string values
|
||||
@@ -51,13 +41,6 @@ class TestAuthLevelDecorator(CustomTestCase):
|
||||
|
||||
self.assertEqual(my_endpoint._auth_level, AuthLevel.ADMIN_FORCE)
|
||||
|
||||
def test_decorator_preserves_function(self):
|
||||
@auth_level(AuthLevel.NORMAL)
|
||||
def my_endpoint():
|
||||
return 42
|
||||
|
||||
self.assertEqual(my_endpoint(), 42)
|
||||
|
||||
|
||||
class TestDecideRequestAuth(CustomTestCase):
|
||||
"""Tests for the pure decide_request_auth function."""
|
||||
|
||||
@@ -45,11 +45,6 @@ class TestNormalizeRopeScalingCompat(unittest.TestCase):
|
||||
normalize_rope_scaling_compat(cfg)
|
||||
self.assertEqual(cfg.rope_scaling["type"], "custom")
|
||||
|
||||
def test_no_op_when_no_rope_scaling(self):
|
||||
cfg = PretrainedConfig()
|
||||
normalize_rope_scaling_compat(cfg)
|
||||
self.assertIsNone(getattr(cfg, "rope_scaling", None))
|
||||
|
||||
def test_no_op_when_rope_scaling_is_none(self):
|
||||
cfg = PretrainedConfig()
|
||||
cfg.rope_scaling = None
|
||||
@@ -479,59 +474,6 @@ class TestPatchRemovedSymbols(unittest.TestCase):
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
|
||||
class TestPatchRopeParametersValidation(unittest.TestCase):
|
||||
# -----------------------------------------------------------------------
|
||||
# Test ``rope_theta`` injection into ``rope_scaling``.
|
||||
#
|
||||
# Upstream `transformers.PretrainedConfig` now natively handles this
|
||||
# logic. While the manual injection patch has been removed, these
|
||||
# test cases are retained to ensure regression testing of the
|
||||
# configuration's injection behavior.
|
||||
# -----------------------------------------------------------------------
|
||||
|
||||
def test_injects_rope_theta_into_rope_scaling(self):
|
||||
config_dict = {
|
||||
"model_type": "llama",
|
||||
"rope_theta": 500000.0,
|
||||
"max_position_embeddings": 131072,
|
||||
"rope_scaling": {
|
||||
"rope_type": "llama3",
|
||||
"factor": 8.0,
|
||||
"low_freq_factor": 1.0,
|
||||
"high_freq_factor": 4.0,
|
||||
"original_max_position_embeddings": 8192,
|
||||
},
|
||||
}
|
||||
config = PretrainedConfig.from_dict(config_dict)
|
||||
rope_params = getattr(config, "rope_parameters", None)
|
||||
if rope_params is not None:
|
||||
self.assertIn("rope_theta", rope_params)
|
||||
|
||||
def test_no_injection_when_rope_theta_already_in_scaling(self):
|
||||
config_dict = {
|
||||
"model_type": "llama",
|
||||
"rope_theta": 500000.0,
|
||||
"max_position_embeddings": 131072,
|
||||
"rope_scaling": {
|
||||
"rope_type": "llama3",
|
||||
"factor": 8.0,
|
||||
"rope_theta": 999.0,
|
||||
"low_freq_factor": 1.0,
|
||||
"high_freq_factor": 4.0,
|
||||
"original_max_position_embeddings": 8192,
|
||||
},
|
||||
}
|
||||
config = PretrainedConfig.from_dict(config_dict)
|
||||
rope_params = getattr(config, "rope_parameters", None)
|
||||
if rope_params is not None:
|
||||
self.assertEqual(rope_params["rope_theta"], 999.0)
|
||||
|
||||
def test_no_crash_without_rope_scaling(self):
|
||||
config_dict = {"model_type": "llama", "rope_theta": 10000.0}
|
||||
config = PretrainedConfig.from_dict(config_dict)
|
||||
self.assertIsNotNone(config)
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# compat: _ensure_clean_up_tokenization_compat
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
@@ -217,32 +217,6 @@ class TestProfileMergerIntegration(CustomTestCase):
|
||||
req = ProfileReq(merge_profiles=True)
|
||||
self.assertTrue(req.merge_profiles)
|
||||
|
||||
def test_integration_parameters(self):
|
||||
import inspect
|
||||
|
||||
# Test TokenizerManager
|
||||
from sglang.srt.managers.tokenizer_control_mixin import (
|
||||
TokenizerControlMixin,
|
||||
)
|
||||
|
||||
sig = inspect.signature(TokenizerControlMixin.start_profile)
|
||||
self.assertIn("req", sig.parameters)
|
||||
self.assertNotIn("merge_profiles", sig.parameters)
|
||||
|
||||
# Test SchedulerProfilerMixin
|
||||
from sglang.srt.managers.scheduler_components.profiler_manager import (
|
||||
SchedulerProfilerManager,
|
||||
)
|
||||
|
||||
sig = inspect.signature(SchedulerProfilerManager._init_profile)
|
||||
self.assertIn("merge_profiles", sig.parameters)
|
||||
|
||||
# Test CLI profiler
|
||||
from sglang.profiler import run_profile
|
||||
|
||||
sig = inspect.signature(run_profile)
|
||||
self.assertIn("merge_profiles", sig.parameters)
|
||||
|
||||
|
||||
class TestProfileMergerEdgeCases(CustomTestCase):
|
||||
def setUp(self):
|
||||
|
||||
Reference in New Issue
Block a user