[CI]Split GPU jobs by cards_* and reject hand-written SKU marks (#6650)
Signed-off-by: wangyu <410167048@qq.com> Signed-off-by: [Your Name] <your.email@example.com>
This commit is contained in:
1 parent
c50b7de167
commit
e338f0ece3
31 files changed
+896
-402
No files matched your search
@@ -0,0 +1,30 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-FileCopyrightText: Copyright contributors to the vLLM-Omni project
|
||||
|
||||
"""Pytest collection-phase hooks.
|
||||
|
||||
All ``pytest_collection_modifyitems`` policies live here so their order is
|
||||
explicit. Add a named helper and call it from the hook; do not register a
|
||||
second ``pytest_collection_modifyitems`` in another plugin.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import pytest
|
||||
|
||||
|
||||
def pytest_collection_modifyitems(config, items):
|
||||
_pin_xdist_serial(config, items)
|
||||
|
||||
|
||||
def _pin_xdist_serial(config, items):
|
||||
"""Pin unmarked tests to one xdist worker.
|
||||
|
||||
Only tests explicitly marked ``pytest.mark.xdist`` run concurrently.
|
||||
Others are pinned to a single xdist worker.
|
||||
"""
|
||||
if not config.pluginmanager.hasplugin("xdist"):
|
||||
return
|
||||
for item in items:
|
||||
if not item.get_closest_marker("xdist"):
|
||||
item.add_marker(pytest.mark.xdist_group(name="serial"))
|
||||
@@ -1,3 +1,10 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-FileCopyrightText: Copyright contributors to the vLLM-Omni project
|
||||
|
||||
"""Pytest CLI options and the fixtures that expose them."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import pytest
|
||||
|
||||
|
||||
@@ -24,6 +24,18 @@ if TYPE_CHECKING:
|
||||
omni_fixture_lock = threading.Lock()
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def _normalized_hardware_marks(request: pytest.FixtureRequest):
|
||||
"""Dummy carrier for mixed-``num_cards`` ``@hardware_test`` mark normalization.
|
||||
|
||||
Pytest has no API to clone an item and only change marks. ``@hardware_test``
|
||||
therefore parametrizes this fixture (``indirect=True``) so each collected
|
||||
item gets one platform's SKU and ``cards_{n}`` without changing test
|
||||
signatures. The returned platform id is unused by test bodies.
|
||||
"""
|
||||
return request.param
|
||||
|
||||
|
||||
@pytest.fixture(scope="function")
|
||||
def omni_server_function(
|
||||
request: pytest.FixtureRequest,
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
"""
|
||||
Only tests explicitly marked ``pytest.mark.xdist`` run concurrently.
|
||||
Other test are pinned to a single xdist worker.
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
||||
|
||||
def pytest_collection_modifyitems(config, items):
|
||||
if not config.pluginmanager.hasplugin("xdist"):
|
||||
return
|
||||
for item in items:
|
||||
if not item.get_closest_marker("xdist"):
|
||||
item.add_marker(pytest.mark.xdist_group(name="serial"))
|
||||
Reference in new issue
Block a user