[Refactor][CI] Reorganize test tree, and move slow e2e to weekly (#4951)
Signed-off-by: wangyu <410167048@qq.com>
This commit is contained in:
1 parent
925347332f
commit
7c17111ff5
158 files changed
+3479
-4130
No files matched your search
@@ -0,0 +1,83 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
|
||||
"""Unit tests for version compatibility warnings."""
|
||||
|
||||
import warnings
|
||||
from unittest import mock
|
||||
|
||||
import pytest
|
||||
|
||||
from vllm_omni.version import warn_if_misaligned_vllm_version
|
||||
|
||||
pytestmark = [pytest.mark.core_model, pytest.mark.cpu]
|
||||
|
||||
|
||||
@mock.patch("vllm_omni.version.__version_tuple__", (0, 19, 0))
|
||||
@mock.patch("vllm_omni.version.__version__", "0.19.0")
|
||||
@mock.patch("vllm.__version_tuple__", (0, 18, 0))
|
||||
@mock.patch("vllm.__version__", "0.18.0")
|
||||
def test_version_mismatch_warning():
|
||||
"""Ensure that we warn when vLLM and vLLM-Omni major/minor versions differ."""
|
||||
with pytest.warns(RuntimeWarning, match="mismatched major/minor versions"):
|
||||
warn_if_misaligned_vllm_version()
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"vllm_ver,vllm_tuple,omni_ver,omni_tuple",
|
||||
[
|
||||
("0.19.0", (0, 19, 0), "0.19.5", (0, 19, 5)), # Patch differs
|
||||
("0.18.0", (0, 18, 0), "dev", (0, 0, "dev")), # Omni dev
|
||||
("dev", (0, 0, "dev"), "0.19.0", (0, 19, 0)), # vLLM dev
|
||||
# Ensure local identifies don't matter for the warning
|
||||
("0.19.0+foo", (0, 19, 0, "foo"), "0.19.5", (0, 19, 0)),
|
||||
("0.19.0", (0, 19, 0), "0.19.5+bar", (0, 19, 0, "bar")),
|
||||
("0.19.0+foo", (0, 19, 0, "foo"), "0.19.5+bar", (0, 19, 0, "bar")),
|
||||
],
|
||||
)
|
||||
def test_no_warning_cases(vllm_ver, vllm_tuple, omni_ver, omni_tuple):
|
||||
"""Ensure we don't warn when minor versions match or either is a dev build."""
|
||||
with (
|
||||
mock.patch.multiple("vllm", __version__=vllm_ver, __version_tuple__=vllm_tuple),
|
||||
mock.patch.multiple("vllm_omni.version", __version__=omni_ver, __version_tuple__=omni_tuple),
|
||||
):
|
||||
with warnings.catch_warnings():
|
||||
warnings.simplefilter("error")
|
||||
warn_if_misaligned_vllm_version()
|
||||
|
||||
|
||||
@mock.patch("vllm_omni.version.__version_tuple__", (0, 19, 0))
|
||||
@mock.patch("vllm_omni.version.__version__", "0.19.0rc2.dev21")
|
||||
@mock.patch("vllm.__version_tuple__", (0, 18, 0))
|
||||
@mock.patch("vllm.__version__", "0.18.0")
|
||||
def test_warning_contains_version_strings():
|
||||
"""Ensure that the warning contains the full version strings."""
|
||||
with pytest.warns(RuntimeWarning) as record:
|
||||
warn_if_misaligned_vllm_version()
|
||||
|
||||
assert len(record) == 1
|
||||
msg = str(record[0].message)
|
||||
assert "0.19.0rc2.dev21" in msg
|
||||
assert "0.18.0" in msg
|
||||
|
||||
|
||||
def test_omni_plugin_loader_invokes_vllm_general_plugins_first(monkeypatch):
|
||||
import vllm.plugins as vllm_plugins
|
||||
|
||||
import vllm_omni.plugins as omni_plugins
|
||||
|
||||
calls = []
|
||||
monkeypatch.setattr(omni_plugins, "omni_plugins_loaded", False)
|
||||
monkeypatch.setattr(vllm_plugins, "load_general_plugins", lambda: calls.append("vllm"))
|
||||
monkeypatch.setattr(
|
||||
omni_plugins,
|
||||
"load_omni_plugins_by_group",
|
||||
lambda group: {"omni": lambda: calls.append(group)},
|
||||
)
|
||||
|
||||
omni_plugins.load_omni_general_plugins()
|
||||
|
||||
assert calls == ["vllm", omni_plugins.OMNI_DEFAULT_PLUGINS_GROUP]
|
||||
|
||||
omni_plugins.load_omni_general_plugins()
|
||||
|
||||
assert calls == ["vllm", omni_plugins.OMNI_DEFAULT_PLUGINS_GROUP]
|
||||
Reference in new issue
Block a user