Skip to content

test: fix find_skipped_tests.py parsing and remove stale CI markers - #3590

Merged
mdboom merged 1 commit into
NVIDIA:mainfrom
mdboom:issue3562
Nov 25, 2026
Merged

mdboom merged 1 commit into
NVIDIA:mainfrom
mdboom:issue3562

Conversation

@mdboom

@mdboom mdboom commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

Closes #3562. Part of #2077.

Summary

The "This test is not currently run in any CI job" markers (#3486) came from the report of toolshed/find_skipped_tests.py. The tool misread pytest output, so 14 markers sit on tests that do run in CI. This PR fixes the parser and removes those markers.

 parse_log(job log)
-  result regex "tests/\S+::\S+ OUTCOME"        # truncates ids with spaces, drops their PASSED lines
-  suite from step name                         # every "run-tests bindings" step -> cuda_bindings_13
-  any line containing SKIPPED -> skipped        # records the truncated ids
+  suite from pytest's "rootdir:" line          # cuda_bindings_12 / _13, cuda_core, cuda_pathfinder
+  ignore sessions outside cuda-python packages # e.g. numba-cuda's own suite in nightly CI
+  result regex accepts spaces in ids, "PARALLEL", progress markers,
+    interleaved free-threaded output, several results per line
+  ignore [NOTSET] (empty parameter set)
 report
+  read only scheduled nightly runs (not manual dispatches)
+  warn about jobs where pytest never ran

Because results are now tagged with their bindings root, a CUDA 12 test can no longer be hidden by its CUDA 13 twin passing, or the reverse.

Markers removed, because each test runs in at least one CI configuration (per-marker job links in #3562):

  • test_device_get_memory_affinity and test_device_get_cpu_affinity_within_scope (cuda_bindings_12 and cuda_bindings_13)
  • test_device_get_nvlink_capability (cuda_bindings_12)
  • test_cuda_gl_register_image_smoketest (cuda_bindings_13)
  • test_repr_format
  • test_replace_address_accepts_managed_buffer_on_nonzero_device and test_from_tiled_accepts_managed_buffer_on_nonzero_device
  • test_numa_node_id
  • test_ml_dtypes_bfloat16_torch_dlpack and test_torch_tensor_bridge_dtypes
  • the [NOTSET] markers in cuda_core/tests/test_utils.py
  • customPyTorchKernel, fftSignalAnalysis, and numpyVsCupy, removed from the scope of the test_sample marker; its other 17 samples still never run

test_always_skip in cuda_bindings_13/tests/test_cuda.py stays, now commented as the tool's canary. The unused copy in cuda_bindings_13/tests/legacy_api/ is deleted.

Bindings roots: I checked the cuda_bindings_12 counterparts. Its affinity and nvlink-capability markers are removed here as well. cuda_bindings_12 has no test_always_skip and no legacy_api copy, and its test_graphics_api_smoketest marker stays because that test still never runs (#3575).

Evidence

  • Before: the tool's 2026-11-17 report in EPIC: Tests that never run in CI #2077 lists, for example, test_device_get_memory_affinity[<AffinityScope.NODE: (truncated), although that test passes on 20 Linux configurations.
  • After: the fixed tool reports 147 tests skipped in every configuration, run against the latest main CI run (45634430012) and the latest scheduled nightly (45532608245). None of them is a test whose marker this PR removes, and none has a truncated or malformed id.
  • Parser check: across 25 real CI job logs (about 7,700 test ids, 16 of the logs from free-threaded jobs), the new parser produces no malformed ids.

To confirm, run the tool and check that none of the tests above appear:

python toolshed/find_skipped_tests.py --repo NVIDIA/cuda-python

Several of the de-marked tests run only in nightly CI (the torch tests, test_numa_node_id, and the three samples). #3562 links the nightly jobs where they pass.

Merge Danger

Door: two-way. Only test comments, one no-op test, and a developer script change; nothing in the packages or CI workflows does.

Blast Radius: none. No runtime or CI behavior changes. The tool's report format changes slightly: test ids now carry their package directory.

Reviewers: please feel free to push commits directly to this PR to improve it.

🤖 Generated with Claude Code

toolshed/find_skipped_tests.py misread pytest output, so the skip list
that the "not currently run in any CI job" markers (NVIDIA#3486) came from
included tests that do run in CI:

- node ids containing spaces were truncated, and their PASSED lines
  were dropped;
- pytest-run-parallel ("PARALLEL PASSED") and interleaved free-threaded
  output was not recognized;
- results from both bindings roots were filed under cuda_bindings_13, so
  a test passing in one root hid the same test never running in the other;
- the nightly run could be a manual dispatch, and jobs where pytest never
  started were not reported.

Attribute results to the package of the pytest session's rootdir, accept
the output shapes CI actually produces, ignore third-party suites and
[NOTSET] ids, read only scheduled nightly runs, and warn about jobs where
pytest never ran. Return job logs directly instead of round-tripping them
through temporary files.

Remove the markers on tests that run in at least one CI configuration.
Keep test_always_skip in cuda_bindings_13/tests/test_cuda.py as the tool's
canary, and delete the unused copy in legacy_api.

Closes NVIDIA#3562

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

Explain Change →

Summary

Summary by CodeRabbit

  • Tests
    • Updated CI test reporting to compare skipped and passing results across active configurations, while ignoring empty-parameter-set results.
    • Reports now flag jobs without a pytest session and verify that the expected skipped-test canary appears.
    • Removed an always-skipped legacy test and outdated comments about tests not running in CI.
    • Updated the documented list of serialized sample keys.

The skipped-test tool now selects specific CI runs, parses pytest outcomes by package and session, and reports tests skipped across active configurations. The PR also removes or revises CI comments on tests and identifies an always-skipped test as the tool’s canary.

Changes: Skipped-test detection

Layer / File(s) Summary
CI run and log collection
toolshed/find_skipped_tests.py
The tool filters nightly runs by event type, retains job names, and fetches logs through the API with a gh run view fallback.
Session parsing and outcome aggregation
toolshed/find_skipped_tests.py
The parser tracks pytest sessions, qualifies test IDs by package, ignores empty parameter sets, and aggregates skipped and non-skipped outcomes across active configurations.
Report, canary, and test annotations
toolshed/find_skipped_tests.py, cuda_bindings_12/tests/nvml/test_pynvml.py, cuda_bindings_13/tests/legacy_api/test_legacy_cuda.py, cuda_bindings_13/tests/nvml/test_pynvml.py, cuda_bindings_13/tests/test_cuda.py, cuda_bindings_13/tests/test_graphics_apis.py, cuda_core/tests/example_tests/test_samples.py, cuda_core/tests/system/test_system_device.py, cuda_core/tests/test_object_protocols.py, cuda_core/tests/test_tensor_map.py, cuda_core/tests/test_utils.py
The report includes jobs without pytest sessions and checks the package-qualified canary. The PR removes stale CI comments, updates the sample-key list, and removes the redundant always-skipped test from the legacy API suite.

Assessment against linked issues

Objective Addressed Explanation
Fix parsing of spaced test IDs, parallel outcomes, and subtest outcomes; ignore empty parameter sets. [3562] ✅
Report configurations or jobs that produce no pytest output and avoid treating missing output as test results. [3562] ✅
Remove stale CI markers and retain or identify the canary. [3562] ✅
Add unit tests with sample log lines for each required outcome format. [3562] ❌ No parser unit tests or sample log cases are included in the supplied changes.

Possibly related issues

  • NVIDIA/cuda-python issue 2077: The PR updates skipped-test parsing and removes stale “not run in CI” annotations, which are part of the epic’s stated scope.
  • NVIDIA/cuda-python issue 3578: The PR removes three sample keys from the comment’s list while retaining the marker for the remaining samples. The changes align the comment with the subset identified as passing. <fixed_issue_severity>Medium</fixed_issue_severity>

Suggested reviewers: rwgk, jpascucci-nv

Change: Bug fix

Merge Risk: Low · up to c6f45

This updates a CI skipped-test reporting tool and removes stale "not run in CI" comments from tests. The tool has a few diagnostic gaps: a fallback log fetch that ignores the selected repository, missing warnings when no pytest ran anywhere, and a rare parsing edge case. The three de-marked samples are not verified automatically as having run. None of this affects shipped code, so the merge risk is low, and the gaps are worth fixing or acknowledging.

Security architecture risk: Minimal · up to c6f45

The script changes which CI logs it reads and how it reports skipped tests. It still uses the operator’s existing GitHub access, and its report is not wired into a CI gate in this repository.

- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

Minor comments: 1

toolshed/find_skipped_tests.py: 1

59-60: Minor · Functional Correctness · Poor tradeoff

suggestion: Do not match outcome words inside parameter IDs.

After a session root is recognized, PYTEST_RESULT can match an outcome word inside a parameter ID. For example, tests/test_x.py::test_case[foo PASSED bar] SKIPPED records tests/test_x.py::test_case[foo as PASSED. The complete skipped test is not recorded as skipped.

This needs a parameter ID that contains a whitespace-delimited outcome word. The search of the available cuda_core sources found no such ID. The cuda_bindings sources are not in this checkout, so that package remains unchecked. Treat this as an edge case rather than a current report error.

Identify the complete node ID before reading an outcome. Include this case in the tests for IDs with spaces and interleaved output.

Review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between d95bb2b and c6f4541.

Files selected for processing: 11

  • cuda_bindings_12/tests/nvml/test_pynvml.py
  • cuda_bindings_13/tests/legacy_api/test_legacy_cuda.py
  • cuda_bindings_13/tests/nvml/test_pynvml.py
  • cuda_bindings_13/tests/test_cuda.py
  • cuda_bindings_13/tests/test_graphics_apis.py
  • cuda_core/tests/example_tests/test_samples.py
  • cuda_core/tests/system/test_system_device.py
  • cuda_core/tests/test_object_protocols.py
  • cuda_core/tests/test_tensor_map.py
  • cuda_core/tests/test_utils.py
  • toolshed/find_skipped_tests.py
Files with no reviewable changes: 8

  • cuda_bindings_12/tests/nvml/test_pynvml.py
  • cuda_bindings_13/tests/legacy_api/test_legacy_cuda.py
  • cuda_bindings_13/tests/nvml/test_pynvml.py
  • cuda_bindings_13/tests/test_graphics_apis.py
  • cuda_core/tests/system/test_system_device.py
  • cuda_core/tests/test_object_protocols.py
  • cuda_core/tests/test_tensor_map.py
  • cuda_core/tests/test_utils.py

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 11 remain after this review.

Comment on lines +31 to +35
# For sample_key values: cuda_core/binarySearch, cuda_core/cudaComputeLambdas, cuda_core/customTensorFlowKernel,
# cuda_core/glInteropFluidNumbaCudaMlir, cuda_core/glInteropFluid, cuda_core/glInteropMipmapLod,
# cuda_core/glInteropPlasma, cuda_core/greenContext, cuda_core/matrixMulSharedMem, cuda_core/multiGPUGradientAverage,
# cuda_core/pageRank, cuda_core/parallelReduction, cuda_core/prefixSum, cuda_core/processCheckpoint,
# cuda_core/reductionMultiBlockCG, cuda_core/simplePrint, cuda_core/tmaTensorMap:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Major · Functional Correctness · Quick win

important: Add a positive CI check for the three samples whose markers are removed.

This change removes the "not currently run in any CI job" marker from customPyTorchKernel, fftSignalAnalysis, and numpyVsCupy. The updated toolshed/find_skipped_tests.py cannot show that these samples ran. universally_skipped returns ever_skipped - ever_non_skipped, and build_summary lists only that set. A sample that never produces a pytest outcome line appears in neither set, so it is not reported. The new warnings cover missing logs and jobs without pytest. They do not report per-test results. The suggested check therefore shows only that a sample is absent from the skipped list. That does not show that the sample ran.

test_sample can also skip a collected sample when no GPU is detected or when run_sample returns WAIVED. Collection alone does not prove execution.

Linked issue #3562 requires an automated way to verify that affected tests run in at least one CI configuration. Add a check that requires a non-skipped result for each of these three samples in at least one configuration. Until such a check exists, the removed markers rely on manual CI observation.

"""Return a job's log, trying `gh api` first and `gh run view` second."""
for args in (
("api", f"repos/{repo}/actions/jobs/{job_id}/logs"),
("run", "view", str(run_id), "--job", str(job_id), "--log"),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor · Functional Correctness · Quick win

important: Preserve the repository in the fallback request.

If the API request fails, the fallback omits repo. When --repo differs from the CLI default, this request cannot reliably retrieve the selected repository's logs. Pass --repo, repo to gh run view; that command supports an explicit repository override. (cli.github.com)

for r in inactive:
lines.append(f"- `{r.workflow_file}` / `{r.name}`")
lines.append("")
lines += bullet_list(

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor · Functional Correctness · Quick win

This comment is about lines 355-357, outside the diff; it is anchored on the nearest change, line 359.

important: Emit job warnings before the no-activity return.

If every fetched job log lacks a pytest session, analyze_config records the job names, but this return bypasses all new warning sections. The report gives no affected configuration or job names.

Emit the diagnostic sections before this return. Keep the short no-activity result, but include the collected setup-failure details.

@github-actions

github-actions Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor
Doc Preview CI
Preview removed because the pull request was closed or merged.

@jpascucci-nv jpascucci-nv left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sol 6.1 High has some comments (as did CodeRabbit, I'm not sure they're as cogent), but other than that it looks okay to me:
[P2] Missing required parser regression tests. The PR rewrites parse_log without adding automated tests. Issue #3562 explicitly requires fixtures covering spaced IDs, PARALLEL results, and subtest outcomes. Add these to the CI tools test suite.

[P3] The no-activity return hides setup-failure diagnostics. In build_summary, the early return precedes the new warning sections. When every configuration fails before pytest, the report omits the recorded job names. I reproduced this; emit the diagnostics before returning.

@mdboom
mdboom enabled auto-merge (squash) November 25, 2026 18:47
@mdboom
mdboom merged commit d067669 into NVIDIA:main Nov 25, 2026
228 of 230 checks passed
github-actions Bot pushed a commit that referenced this pull request Nov 26, 2026
Removed preview folders for the following PRs:
- PR #3521
- PR #3526
- PR #3547
- PR #3548
- PR #3549
- PR #3552
- PR #3589
- PR #3590
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cuda.bindings Everything related to the cuda.bindings module cuda.core Everything related to the cuda.core module test Improvements or additions to tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test: fix find_skipped_tests.py parsing and remove stale 'not run in any CI job' markers

2 participants