Files
Model-Optimizer/tests/conftest.py
T
noeyy-minoandcoderabbitai[bot] d311edaf5f Add functional test cases for published checkpoints on HF (#455)
## What does this PR do?

**Type of change:** new tests

**Overview:** 
Add vLLM/SGLang/TRT LLM deployment tests for published checkpoints on
HF.
Add e2e test case for gpt-oss

## Usage


```python
# pytest test_deploy.py -k "vllm"
```

## Testing


## Before your PR is "*Ready for review*"


- **Make sure you read and follow [Contributor
guidelines](https://github.com/NVIDIA/TensorRT-Model-Optimizer/blob/main/CONTRIBUTING.md)**
and your commits are signed.
- **Is this change backward compatible?**: Yes
- **Did you write any new necessary tests?**: No
- **Did you add or update any necessary documentation?**: No
- **Did you update
[Changelog](https://github.com/NVIDIA/TensorRT-Model-Optimizer/blob/main/CHANGELOG.rst)?**:
No

## Additional Information


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Tests**
* Added ModelDeployer and ModelDeployerList test utilities with
COMMON_PROMPTS to run multi-backend deployment and inference scenarios.
* Introduced an end-to-end GPT-OSS QAT pipeline test (SFT → QAT → MXFP4
conversion) with optional deployment/benchmarking.
* Added a broad parametric LLM deployment test suite covering many
models/backends with readable test IDs.
* Added automatic Hugging Face cache cleanup after tests to keep runs
isolated.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Signed-off-by: neoyy-mino <174223378+noeyy-mino@users.noreply.github.com>
Signed-off-by: noeyy-mino <174223378+noeyy-mino@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2025-11-14 16:15:38 +05:30

60 lines
1.7 KiB
Python

# SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import platform
import pytest
@pytest.fixture(scope="session")
def verbose(request):
return request.config.getoption("verbose")
def pytest_addoption(parser):
parser.addoption(
"--run-manual",
action="store_true",
default=False,
help="Run manual tests",
)
parser.addoption(
"--run-release",
action="store_true",
default=False,
help="Run release tests",
)
def pytest_collection_modifyitems(config, items):
"""Skip tests with specific markers unless their corresponding flag is provided."""
skip_marks = [
("manual", "--run-manual"),
("release", "--run-release"),
]
for mark_name, option_name in skip_marks:
if not config.getoption(option_name):
skipper = pytest.mark.skip(reason=f"Only run when {option_name} is given")
for item in items:
if mark_name in item.keywords:
item.add_marker(skipper)
@pytest.fixture
def skip_on_windows():
if platform.system() == "Windows":
pytest.skip("Skipping on Windows")