# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contributors to the vLLM-Omni project from pathlib import Path from shlex import split import pytest import yaml pytestmark = [pytest.mark.core_model, pytest.mark.cpu] AMD_MERGE_PIPELINE = Path(".buildkite/amd/test-amd-merge.yml") AMD_NIGHTLY_PIPELINE = Path(".buildkite/amd/test-amd-nightly.yml") def _find_step(label: str, pipeline_path: Path = AMD_MERGE_PIPELINE) -> dict: pipeline = yaml.safe_load(pipeline_path.read_text(encoding="utf-8")) def walk(steps: list[dict]) -> dict | None: for step in steps: if step.get("label") == label: return step if nested := walk(step.get("steps", [])): return nested return None step = walk(pipeline.get("steps", [])) assert step is not None, f"missing AMD pipeline step: {label}" return step def test_qwen3_tts_base_preserves_advanced_model_arguments() -> None: step = _find_step("Qwen3-TTS Base E2E Test") commands = step["commands"] assert all("bash -c" not in command for command in commands) pytest_command = next(command for command in commands if "pytest" in command) argv = split(pytest_command) marker_index = argv.index("-m") run_level_index = argv.index("--run-level") assert argv[marker_index + 1] == "advanced_model and cuda" assert argv[run_level_index + 1] == "advanced_model" def test_qwen3_accuracy_defers_artifact_path_expansion() -> None: step = _find_step("Qwen3-Omni Accuracy", AMD_NIGHTLY_PIPELINE) staging_command = next(command for command in step["commands"] if "artifact_dir=" in command) # Dynamic pipelines are interpolated once during upload. Double dollars # preserve these variables for the GPU job's runtime shell. assert '"$$PWD"' in staging_command assert '"$${BUILDKITE_BUILD_CHECKOUT_PATH:?}"' in staging_command assert '"$$artifact_dir"' in staging_command assert step["artifact_paths"] == ["tests/e2e/accuracy/qwen3_omni/results/qwen_omni_acc/*.json"]