CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
86 lines
2.7 KiB
Python
86 lines
2.7 KiB
Python
# Copyright Advanced Micro Devices, Inc., or its affiliates.
|
|
# SPDX-License-Identifier: MIT
|
|
|
|
"""Tests for configure.py CLI interface.
|
|
|
|
Usage:
|
|
python3 -m pytest tests/test_configure.py \\
|
|
--hipblaslt-path /path/to/hipblaslt \\
|
|
--workload /path/to/workload.yaml \\
|
|
[--hw gfx942]
|
|
|
|
``--hw`` sets ``configure.py --architecture`` (default: gfx950).
|
|
"""
|
|
|
|
import subprocess
|
|
import sys
|
|
import warnings
|
|
from pathlib import Path
|
|
|
|
import pytest
|
|
|
|
ROOT = Path(__file__).resolve().parents[1]
|
|
|
|
|
|
# ---------------------------------------------------------------------------
|
|
# End-to-end integration test
|
|
# ---------------------------------------------------------------------------
|
|
|
|
|
|
@pytest.mark.slow
|
|
class TestIntegration:
|
|
"""Run configure.py against a real workload YAML and hipBLASLt repo.
|
|
|
|
Usage:
|
|
python3 -m pytest tests/test_configure.py \\
|
|
--hipblaslt-path ~/rocm-libraries/projects/hipblaslt \\
|
|
--workload workload.yaml
|
|
"""
|
|
|
|
def test_full_cli_run(self, hipblaslt_path, workload_path, hw_arch, tmp_path):
|
|
"""Full configure CLI completes (uses conftest CLI options)."""
|
|
if hipblaslt_path is None or workload_path is None:
|
|
msg = "Skipped: requires --hipblaslt-path and --workload CLI options"
|
|
warnings.warn(msg, stacklevel=1)
|
|
pytest.skip(msg)
|
|
|
|
hip = Path(hipblaslt_path)
|
|
workload = Path(workload_path)
|
|
if not hip.is_dir():
|
|
msg = f"Skipped: hipBLASLt path not found: {hip}"
|
|
warnings.warn(msg, stacklevel=1)
|
|
pytest.skip(msg)
|
|
if not workload.is_file():
|
|
msg = f"Skipped: workload file not found: {workload}"
|
|
warnings.warn(msg, stacklevel=1)
|
|
pytest.skip(msg)
|
|
|
|
workdir = tmp_path / "workdir"
|
|
run_cwd = str(tmp_path.resolve())
|
|
configure_py = str((ROOT / "scripts" / "configure.py").resolve())
|
|
result = subprocess.run(
|
|
[
|
|
sys.executable,
|
|
configure_py,
|
|
str(workload.resolve()),
|
|
"--hipblaslt",
|
|
str(hip.resolve()),
|
|
"--workdir",
|
|
str(workdir.resolve()),
|
|
"--architecture",
|
|
hw_arch,
|
|
],
|
|
cwd=run_cwd,
|
|
capture_output=True,
|
|
text=True,
|
|
timeout=600,
|
|
)
|
|
assert result.returncode == 0, (
|
|
f"configure.py exited with code {result.returncode}\n"
|
|
f"--- stdout ---\n{result.stdout[-2000:]}\n"
|
|
f"--- stderr ---\n{result.stderr[-2000:]}"
|
|
)
|
|
assert workdir.is_dir()
|
|
generated = list(workdir.rglob("*"))
|
|
assert len(generated) > 0, "Expected output files but workdir is empty"
|