Skip to content

Commit 022da91

Browse files
Count test totals correctly for dashboards (#280)
* Account test totals correctly for dashboards * Add blurb to the dev guide on skipping tests * Remove extra newline * Default to 0 if "skipped" isn't found Co-authored-by: Mathew Odden <[email protected]> --------- Co-authored-by: Mathew Odden <[email protected]>
1 parent 9cc5452 commit 022da91

File tree

3 files changed

+20
-1
lines changed

3 files changed

+20
-1
lines changed

.github/workflows/rocm-ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ jobs:
6060
path: ./dist/*.whl
6161
- name: Run tests
6262
env:
63+
ROCM_TEST_INCLUDE_SKIPS: "1"
6364
GPU_COUNT: "8"
6465
GFX: "gfx90a"
6566
run: |

rocm-downstream-dev-guide.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ This guide lays out how to do some dev operations, what branches live in this re
3030
If upstream reviewers request some changes to the new PR before merging, you can add
3131
or modify commits on the new `-upstream` feature branch.
3232
b. If this is an urgent change that we want in `rocm-main` right now but also want upstream,
33-
add the `open-upstream` label, merge your PR, and then follow the link that
33+
add the `open-upstream` label, merge your PR, and then follow the link that
3434
c. If this is a change that we only want to keep in `rocm/jax` and not push into upstream,
3535
squash and merge your PR.
3636

@@ -63,3 +63,7 @@ development tasks. These all live in `.github/workflows`.
6363
| ROCm Open Upstream PR | `rocm-open-upstream-pr.yml` | Add the `open-upstream` label to a PR | Copies changes from a PR aimed at `rocm-main` into a new PR aimed at upstream's `main` |
6464
| ROCm Nightly Upstream Sync | `rocm-nightly-upstream-sync.yml` | Runs nightly, can be triggered manually via Actions | Opens a PR that merges changes from upstream `main` into our `rocm-main` branch |
6565

66+
# Test Guidlines
67+
68+
Use `pytest.mark.xfail` or `pytest.mark.xfail(run=False)` to skip failing tests that we will fix later. Use these for tests that we do eventually want to pass, but that we will skip for now to keep CI green. Continue to use `unittest.skip` or `self.skip` for tests that aren't applicable to AMD hardware.
69+

tests/conftest.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import os
2+
import pytest
3+
4+
5+
INCLUDE_SKIPS = os.getenv("ROCM_TEST_INCLUDE_SKIPS", default=False)
6+
7+
@pytest.hookimpl(optionalhook=True)
8+
def pytest_json_modifyreport(json_report):
9+
"""Get rid of skipped tests in reporting. We only care about xfails."""
10+
if (not INCLUDE_SKIPS
11+
and "summary" in json_report
12+
and "total" in json_report["summary"]):
13+
json_report["summary"]["unskipped_total"] = json_report["summary"]["total"] - json_report["summary"].get("skipped", 0)
14+
del json_report["summary"]["total"]

0 commit comments

Comments
 (0)