Skip to content

Commit 2a12353

Browse files
ci: Gate Windows hip-tests ROCR job behind opt-in flag (#4878)
Add a WINDOWS_HIP_ROCR_TESTS CI flag to control whether the Windows hip-tests (ROCR) matrix entry is emitted. Windows hip-tests (PAL) remains enabled by default, while ROCR coverage can be opted into through the new windows_hip_rocr_tests workflow input. Update fetch_test_configurations.py to read the flag, wire the input through test_artifacts.yml, and adjust tests so the default path emits PAL only while ROCR-specific cases opt in explicitly. This keeps current callers unaffected while preserving a temporary path for ROCR parity tracking until issue #3587 is resolved.
1 parent 00f0ba4 commit 2a12353

3 files changed

Lines changed: 44 additions & 18 deletions

File tree

.github/workflows/test_artifacts.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ on:
3131
run_extended_tests:
3232
type: string
3333
default: 'false'
34+
windows_hip_rocr_tests:
35+
type: string
36+
default: 'false'
3437
release_type:
3538
description: 'Release type: "" for CI, or "dev", "nightly", "prerelease".'
3639
type: string
@@ -62,6 +65,9 @@ on:
6265
run_extended_tests:
6366
type: string
6467
default: 'false'
68+
windows_hip_rocr_tests:
69+
type: string
70+
default: 'false'
6571
release_type:
6672
type: string
6773
default: ""
@@ -114,6 +120,7 @@ jobs:
114120
TEST_TYPE: ${{ inputs.test_type }}
115121
TEST_LABELS: ${{ inputs.test_labels }}
116122
RUN_EXTENDED_TESTS: ${{ inputs.run_extended_tests }}
123+
WINDOWS_HIP_ROCR_TESTS: ${{ inputs.windows_hip_rocr_tests }}
117124
run: python ./build_tools/github_actions/fetch_test_configurations.py
118125

119126
test_sanity_check:

build_tools/github_actions/fetch_test_configurations.py

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -573,6 +573,7 @@ def run():
573573
test_type = os.getenv("TEST_TYPE", "full")
574574
test_labels = ast.literal_eval(os.getenv("TEST_LABELS") or "[]")
575575
run_extended_tests = str2bool(os.getenv("RUN_EXTENDED_TESTS", "false"))
576+
windows_hip_rocr_tests = str2bool(os.getenv("WINDOWS_HIP_ROCR_TESTS", "false"))
576577

577578
logging.info(f"Selecting projects: {projects_to_test}")
578579

@@ -631,9 +632,9 @@ def run():
631632
):
632633
logging.info(f"Including job {job_name} with test_type {test_type}")
633634

634-
# Hip-tests on Windows run twice: PAL (pass/fail) and ROCR (informational)
635-
# for parity tracking until ROCR is the pass/fail path. See:
636-
# https://github.com/ROCm/TheRock/issues/3587
635+
# Hip-tests on Windows: always run PAL (pass/fail). Optionally also run
636+
# ROCR (informational) for parity tracking when WINDOWS_HIP_ROCR_TESTS=true.
637+
# See: https://github.com/ROCm/TheRock/issues/3587
637638
if key == "hip-tests" and platform == "windows":
638639
base = selected_matrix[key]
639640
total_shards = base.get("total_shards_dict", {}).get(platform, 1)
@@ -654,19 +655,20 @@ def run():
654655
}
655656
all_components.append(pal_entry)
656657

657-
rocr_entry = {
658-
"job_name": "hip-tests (ROCR)",
659-
"fetch_artifact_args": base["fetch_artifact_args"],
660-
"timeout_minutes": base["timeout_minutes"],
661-
"test_script": base["test_script"],
662-
"platform": base["platform"],
663-
"total_shards": total_shards,
664-
"test_type": test_type,
665-
"shard_arr": shard_arr,
666-
"expect_failure": True,
667-
"gpu_enable_pal": "0",
668-
}
669-
all_components.append(rocr_entry)
658+
if windows_hip_rocr_tests:
659+
rocr_entry = {
660+
"job_name": "hip-tests (ROCR)",
661+
"fetch_artifact_args": base["fetch_artifact_args"],
662+
"timeout_minutes": base["timeout_minutes"],
663+
"test_script": base["test_script"],
664+
"platform": base["platform"],
665+
"total_shards": total_shards,
666+
"test_type": test_type,
667+
"shard_arr": shard_arr,
668+
"expect_failure": True,
669+
"gpu_enable_pal": "0",
670+
}
671+
all_components.append(rocr_entry)
670672
continue
671673

672674
job_config_data = selected_matrix[key]

build_tools/github_actions/tests/fetch_test_configurations_test.py

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,10 +267,26 @@ def fake_get_all_families(_):
267267
# Output contract
268268
# -----------------------
269269

270+
def test_windows_hip_tests_default_emits_pal_only(self):
271+
"""On Windows, hip-tests emits only PAL by default (WINDOWS_HIP_ROCR_TESTS off)."""
272+
os.environ["RUNNER_OS"] = "Windows"
273+
os.environ["TEST_LABELS"] = json.dumps(["hip-tests"])
274+
275+
fetch_test_configurations.run()
276+
components = self._get_components()
277+
278+
hip_jobs = [j for j in components if "hip-tests" in j["job_name"]]
279+
self.assertEqual(len(hip_jobs), 1, "Expected only hip-tests (PAL)")
280+
self.assertEqual(hip_jobs[0]["job_name"], "hip-tests (PAL)")
281+
self.assertNotIn("expect_failure", hip_jobs[0])
282+
self.assertEqual(hip_jobs[0]["total_shards"], 4)
283+
self.assertEqual(hip_jobs[0]["shard_arr"], [1, 2, 3, 4])
284+
270285
def test_windows_hip_tests_emits_pal_and_rocr_entries(self):
271-
"""On Windows, hip-tests run twice: PAL (pass/fail) and ROCR (informational)."""
286+
"""On Windows with WINDOWS_HIP_ROCR_TESTS=true, hip-tests runs PAL and ROCR."""
272287
os.environ["RUNNER_OS"] = "Windows"
273288
os.environ["TEST_LABELS"] = json.dumps(["hip-tests"])
289+
os.environ["WINDOWS_HIP_ROCR_TESTS"] = "true"
274290

275291
fetch_test_configurations.run()
276292
components = self._get_components()
@@ -293,10 +309,11 @@ def test_windows_hip_tests_emits_pal_and_rocr_entries(self):
293309
self.assertEqual(rocr["shard_arr"], [1, 2, 3, 4])
294310

295311
def test_windows_hip_tests_quick_uses_single_shard(self):
296-
"""On Windows with test_type=quick, hip-tests PAL/ROCR each use 1 shard."""
312+
"""On Windows with test_type=quick and ROCR enabled, PAL/ROCR each use 1 shard."""
297313
os.environ["RUNNER_OS"] = "Windows"
298314
os.environ["TEST_LABELS"] = json.dumps(["hip-tests"])
299315
os.environ["TEST_TYPE"] = "quick"
316+
os.environ["WINDOWS_HIP_ROCR_TESTS"] = "true"
300317

301318
fetch_test_configurations.run()
302319
components = self._get_components()

0 commit comments

Comments
 (0)