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
77 lines
2.6 KiB
Python
77 lines
2.6 KiB
Python
# Copyright Advanced Micro Devices, Inc.
|
|
# SPDX-License-Identifier: MIT
|
|
|
|
"""Thin wrapper that runs MIOpen tests through the standardized test runner.
|
|
|
|
MIOpen's test selection is owned by the test filter standardization in
|
|
rocm-libraries (``projects/miopen/test/gtest/test_categories.yaml``), which is
|
|
compiled into an installed ``bin/MIOpen/CTestTestfile.cmake`` and consumed by
|
|
the generic ``test_runner.py`` via ctest category labels (quick / standard /
|
|
comprehensive / full) plus GPU-specific ``ex_gpu_<arch>`` exclusions.
|
|
|
|
This convenience script simply delegates to ``test_runner.py`` so the YAML is
|
|
the single source of truth.
|
|
|
|
The test category can be selected with ``--test-type`` (alias ``--category``)
|
|
or the ``TEST_TYPE`` environment variable. Precedence is: CLI option, then
|
|
``TEST_TYPE``, then the default of "standard". All other configuration
|
|
(THEROCK_BIN_DIR, AMDGPU_FAMILIES, SHARD_INDEX, TOTAL_SHARDS, ...) is read by
|
|
test_runner.py from the environment.
|
|
"""
|
|
|
|
import argparse
|
|
import logging
|
|
import os
|
|
import shlex
|
|
import subprocess
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
SCRIPT_DIR = Path(__file__).resolve().parent
|
|
TEST_RUNNER = SCRIPT_DIR / "test_runner.py"
|
|
|
|
# Categories defined by the MIOpen test filter standardization.
|
|
TEST_CATEGORIES = ["quick", "standard", "comprehensive", "full"]
|
|
|
|
# Default category when neither --test-type nor TEST_TYPE is provided.
|
|
# (GitHub Actions passes an empty string when a workflow input is left blank.)
|
|
DEFAULT_TEST_TYPE = "standard"
|
|
|
|
logging.basicConfig(level=logging.INFO)
|
|
|
|
|
|
def main() -> int:
|
|
parser = argparse.ArgumentParser(
|
|
description="Run MIOpen tests via the standardized ctest test runner."
|
|
)
|
|
parser.add_argument(
|
|
"--test-type",
|
|
"--category",
|
|
dest="test_type",
|
|
choices=TEST_CATEGORIES,
|
|
default=None,
|
|
help=(
|
|
"Test category to run. Overrides the TEST_TYPE environment "
|
|
f"variable. Defaults to TEST_TYPE or '{DEFAULT_TEST_TYPE}'."
|
|
),
|
|
)
|
|
args = parser.parse_args()
|
|
|
|
# Precedence: CLI option > TEST_TYPE env var > default.
|
|
category = args.test_type or os.getenv("TEST_TYPE") or DEFAULT_TEST_TYPE
|
|
|
|
env = os.environ.copy()
|
|
# This script always tests MIOpen; test_runner.py maps "miopen" -> "MIOpen".
|
|
env["TEST_COMPONENT"] = "miopen"
|
|
env["TEST_TYPE"] = category
|
|
|
|
logging.info(f"MIOpen test category (TEST_TYPE): {category}")
|
|
|
|
cmd = [sys.executable, str(TEST_RUNNER)]
|
|
logging.info(f"++ Exec $ {shlex.join(cmd)}")
|
|
return subprocess.run(cmd, env=env, check=False).returncode
|
|
|
|
|
|
if __name__ == "__main__":
|
|
sys.exit(main())
|