rebase: align vllm-omni with vLLM d2906cc19586
Signed-off-by: tzhouam <tzhouam@connect.ust.hk>
This commit is contained in:
1 parent
94914a1270
commit
e4c47a2569
4 files changed
+48
-6
No files matched your search
@@ -0,0 +1,38 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-FileCopyrightText: Copyright contributors to the vLLM-Omni project
|
||||
|
||||
import logging
|
||||
|
||||
import pytest
|
||||
|
||||
import vllm_omni.platforms as platforms
|
||||
|
||||
pytestmark = [pytest.mark.core_model, pytest.mark.cpu]
|
||||
|
||||
|
||||
def test_failing_oot_plugin_is_logged_and_falls_back(monkeypatch, caplog):
|
||||
plugin_name = "raising_oot_plugin"
|
||||
|
||||
def raising_plugin():
|
||||
raise RuntimeError("injected platform detection failure")
|
||||
|
||||
monkeypatch.setattr(platforms, "builtin_omni_platform_plugins", {})
|
||||
monkeypatch.setattr(
|
||||
platforms,
|
||||
"load_omni_plugins_by_group",
|
||||
lambda _group: {plugin_name: raising_plugin},
|
||||
)
|
||||
|
||||
target_logger = logging.getLogger(platforms.__name__)
|
||||
target_logger.addHandler(caplog.handler)
|
||||
previous_level = target_logger.level
|
||||
target_logger.setLevel(logging.DEBUG)
|
||||
try:
|
||||
platform_cls = platforms.resolve_current_omni_platform_cls_qualname()
|
||||
finally:
|
||||
target_logger.removeHandler(caplog.handler)
|
||||
target_logger.setLevel(previous_level)
|
||||
|
||||
assert platform_cls == "vllm_omni.platforms.interface.UnspecifiedOmniPlatform"
|
||||
assert plugin_name in caplog.text
|
||||
assert "RuntimeError: injected platform detection failure" in caplog.text
|
||||
Reference in new issue
Block a user