Skip to content

Commit a79bc5c

Browse files
authored
[CI] Fix ROCm CI (#1043)
* [CI] fix ROCm CI * feat: add a hook to error out on no test runs
1 parent 1f4ffdb commit a79bc5c

File tree

3 files changed

+49
-4
lines changed

3 files changed

+49
-4
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ jobs:
9090
name: self-hosted-amd
9191
# Format: [Nightly-]ROCm-<major>.<minor>[.<patch>]. E.g., "ROCm-6.4" or "Nightly-ROCm-7.0".
9292
# Use "Nightly-" prefix to use torch nightly builds.
93-
toolkit: Nightly-ROCm-7.0
93+
toolkit: ROCm-6.3
9494
- tags: [macos-latest]
9595
name: macos-latest
9696
toolkit: Metal # or Nightly-Metal
@@ -352,8 +352,6 @@ jobs:
352352
- name: Run ROCm tests with Python ${{ matrix.python-version }} (${{ matrix.runner.toolkit }})
353353
id: rocm-tests
354354
if: contains(matrix.runner.toolkit, 'ROCm')
355-
# FIXME: ROCm test incorrectly skips tests
356-
continue-on-error: true
357355
run: |
358356
cd testing
359357
PYTEST=(
@@ -362,7 +360,6 @@ jobs:
362360
)
363361
"${PYTEST[@]}" --maxfail=3 --numprocesses=4 \
364362
./python/amd/test_tilelang_test_amd.py
365-
echo "::error::ROCm tests are known to be skipped incorrectly due to ROCm TVM build issues." >&2
366363
367364
# Apple Metal tests
368365
- name: Run Metal tests with Python ${{ matrix.python-version }} (${{ matrix.runner.toolkit }})

examples/conftest.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import os
22
import random
3+
import pytest
34

45
os.environ["PYTHONHASHSEED"] = "0"
56

@@ -18,3 +19,26 @@
1819
pass
1920
else:
2021
np.random.seed(0)
22+
23+
24+
def pytest_terminal_summary(terminalreporter, exitstatus, config):
25+
"""Ensure that at least one test is collected. Error out if all tests are skipped."""
26+
known_types = {
27+
"failed",
28+
"passed",
29+
"skipped",
30+
"deselected",
31+
"xfailed",
32+
"xpassed",
33+
"warnings",
34+
"error",
35+
}
36+
if (sum(
37+
len(terminalreporter.stats.get(k, []))
38+
for k in known_types.difference({"skipped", "deselected"})) == 0):
39+
terminalreporter.write_sep(
40+
"!",
41+
(f"Error: No tests were collected. "
42+
f"{dict(sorted((k, len(v)) for k, v in terminalreporter.stats.items()))}"),
43+
)
44+
pytest.exit("No tests were collected.", returncode=5)

testing/conftest.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import os
22
import random
3+
import pytest
34

45
os.environ["PYTHONHASHSEED"] = "0"
56

@@ -18,3 +19,26 @@
1819
pass
1920
else:
2021
np.random.seed(0)
22+
23+
24+
def pytest_terminal_summary(terminalreporter, exitstatus, config):
25+
"""Ensure that at least one test is collected. Error out if all tests are skipped."""
26+
known_types = {
27+
"failed",
28+
"passed",
29+
"skipped",
30+
"deselected",
31+
"xfailed",
32+
"xpassed",
33+
"warnings",
34+
"error",
35+
}
36+
if (sum(
37+
len(terminalreporter.stats.get(k, []))
38+
for k in known_types.difference({"skipped", "deselected"})) == 0):
39+
terminalreporter.write_sep(
40+
"!",
41+
(f"Error: No tests were collected. "
42+
f"{dict(sorted((k, len(v)) for k, v in terminalreporter.stats.items()))}"),
43+
)
44+
pytest.exit("No tests were collected.", returncode=5)

0 commit comments

Comments
 (0)