Skip to content

Suppress the pathfinder INFO summary on repeats, not on plugin presence - #2561

Open
LeSingh1 wants to merge 1 commit into
NVIDIA:mainfrom
LeSingh1:pathfinder-info-summary-guard
Open

Suppress the pathfinder INFO summary on repeats, not on plugin presence#2561
LeSingh1 wants to merge 1 commit into
NVIDIA:mainfrom
LeSingh1:pathfinder-info-summary-guard

Conversation

@LeSingh1

@LeSingh1 LeSingh1 commented Aug 9, 2026

Copy link
Copy Markdown
Contributor
def pytest_terminal_summary(terminalreporter, exitstatus, config):
    if not config.getoption("verbose"):
        return
    if hasattr(config.option, "iterations"):  # pytest-freethreaded runs all tests at least twice
        return
    if getattr(config.option, "count", 1) > 1:  # pytest-repeat
        return

The comment states the intent: suppress the summary only when the run repeats tests.
The pytest-repeat line implements exactly that (count > 1). The pytest-freethreaded line
checks only that the option exists.

--iterations is registered by the plugin with a default of 1, so merely having
pytest-freethreaded installed suppresses the summary on an ordinary pytest -v run — no
repetition required.

That matters because the INFO summary is the only output of the info_summary_append
fixture, which test_load_nvidia_dynamic_lib, test_driver_lib_loading,
test_find_nvidia_headers, test_find_static_lib and test_find_bitcode_lib use to
report what they actually discovered on the host. It would silently disappear.

The plugin is not currently in cuda_pathfinder's test dependency group
(pytest, pytest-mock, pytest-repeat, pytest-randomly), so this is dormant today —
but #2114 moves the repo toward parallel-test plugins, and pytest.ini already registers
the thread_unsafe / parallel_threads_limit markers, so it is worth having right before
that lands rather than after.

Fix

Make the check symmetric with the pytest-repeat one:
getattr(config.option, "iterations", 1) > 1.

Test

New cuda_pathfinder/tests/test_conftest_info_summary.py drives the hook directly with
stub config / terminalreporter objects — no plugin install and no CUDA needed — across
the matrix of plugin absent / present-with-1 / present-with-2 for both plugins, plus the
-v gate.

Two of its cases (freethreaded-single, both-single) fail on main: the summary is
suppressed even though nothing repeats.

Verified: pytest cuda_pathfinder/tests has the same pass/fail set as main otherwise;
ruff check, ruff format --check and the pre-commit mypy-pathfinder invocation are all
clean.

    if hasattr(config.option, "iterations"):  # pytest-freethreaded runs all tests at least twice
        return
    if getattr(config.option, "count", 1) > 1:  # pytest-repeat
        return

The comment states the intent: suppress the summary only when the run
repeats tests. The pytest-repeat line implements exactly that. The
pytest-freethreaded line checks only that the option *exists*.

--iterations is registered by the plugin with a default of 1, so merely
having pytest-freethreaded installed suppresses the summary on an ordinary
`pytest -v` run. The INFO summary is the only output of the
info_summary_append fixture, which test_load_nvidia_dynamic_lib,
test_driver_lib_loading, test_find_nvidia_headers, test_find_static_lib and
test_find_bitcode_lib use to report what they actually discovered -- so it
would silently disappear.

The plugin is not currently in cuda_pathfinder's test dependency group, so
this is dormant today, but NVIDIA#2114 moves the repo toward parallel-test plugins.

Make the check symmetric with the pytest-repeat one:
getattr(config.option, "iterations", 1) > 1.

Adds tests/test_conftest_info_summary.py, which drives the hook with stub
config/reporter objects across both plugins present/absent and
single/repeated. Two of its cases fail before this change.
@copy-pr-bot

copy-pr-bot Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@github-actions github-actions Bot added the cuda.pathfinder Everything related to the cuda.pathfinder module label Aug 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cuda.pathfinder Everything related to the cuda.pathfinder module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant