Files
TheRock/rocm-systems/shared/kpack/tests/common/conftest.py
T
derek.holloway 7502bf64a4
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
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

89 lines
2.8 KiB
Python

"""
Cross-platform test fixtures for common tests.
These fixtures parameterize tests by (platform, co_version) tuples,
allowing the same test logic to run against both ELF and COFF binaries.
"""
import pytest
from pathlib import Path
# Asset configurations: (platform, co_version)
# Parameterized to allow future expansion (e.g., cov6)
ASSET_CONFIGS = [
("linux", "cov5"),
("windows", "cov5"),
]
@pytest.fixture(params=ASSET_CONFIGS, ids=lambda x: f"{x[0]}-{x[1]}")
def asset_config(request):
"""Returns (platform, co_version) tuple for parameterized tests."""
return request.param
@pytest.fixture
def bundled_assets_dir(test_assets_dir: Path, asset_config: tuple[str, str]) -> Path:
"""Path to bundled binaries for this platform/co_version."""
platform, co_version = asset_config
assets_dir = test_assets_dir / "bundled_binaries" / platform / co_version
if not assets_dir.exists():
raise FileNotFoundError(
f"Required test assets directory not found: {assets_dir}"
)
return assets_dir
@pytest.fixture
def single_arch_exe(bundled_assets_dir: Path) -> Path:
"""Path to single-arch executable for this platform."""
path = bundled_assets_dir / "test_kernel_single.exe"
if not path.exists():
raise FileNotFoundError(f"Required test asset not found: {path}")
return path
@pytest.fixture
def multi_arch_exe(bundled_assets_dir: Path) -> Path:
"""Path to multi-arch executable for this platform."""
path = bundled_assets_dir / "test_kernel_multi.exe"
if not path.exists():
raise FileNotFoundError(f"Required test asset not found: {path}")
return path
@pytest.fixture
def single_arch_lib(bundled_assets_dir: Path, asset_config: tuple[str, str]) -> Path:
"""Path to single-arch shared library for this platform."""
platform, _ = asset_config
if platform == "windows":
path = bundled_assets_dir / "test_kernel_single.dll"
else:
path = bundled_assets_dir / "libtest_kernel_single.so"
if not path.exists():
raise FileNotFoundError(f"Required test asset not found: {path}")
return path
@pytest.fixture
def host_only_exe(bundled_assets_dir: Path) -> Path:
"""Path to host-only executable (no GPU code)."""
path = bundled_assets_dir / "host_only.exe"
if not path.exists():
raise FileNotFoundError(f"Required test asset not found: {path}")
return path
@pytest.fixture
def host_only_lib(bundled_assets_dir: Path, asset_config: tuple[str, str]) -> Path:
"""Path to host-only shared library (no GPU code)."""
platform, _ = asset_config
if platform == "windows":
path = bundled_assets_dir / "host_only.dll"
else:
path = bundled_assets_dir / "libhost_only.so"
if not path.exists():
raise FileNotFoundError(f"Required test asset not found: {path}")
return path