Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions ci/tools/run-tests
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,7 @@ if [[ "${test_module}" == "pathfinder" ]]; then
echo "Running pathfinder tests with " \
"LD:${CUDA_PATHFINDER_TEST_LOAD_NVIDIA_DYNAMIC_LIB_STRICTNESS} " \
"FH:${CUDA_PATHFINDER_TEST_FIND_NVIDIA_HEADERS_STRICTNESS}"
pytest -ra -s -v tests/ |& tee /tmp/pathfinder_test_log.txt
# Fail if no "INFO test_" lines are found; capture line count otherwise
line_count=$(grep '^INFO test_' /tmp/pathfinder_test_log.txt | wc -l)
echo "Number of \"INFO test_\" lines: $line_count"
pytest -ra --log-cli-level=INFO -v tests/
popd
elif [[ "${test_module}" == "bindings" ]]; then
pushd "${CUDA_BINDINGS_ARTIFACTS_DIR}"
Expand Down
24 changes: 0 additions & 24 deletions cuda_pathfinder/tests/conftest.py

This file was deleted.

9 changes: 5 additions & 4 deletions cuda_pathfinder/tests/test_find_nvidia_headers.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

import functools
import importlib.metadata
import logging
import os
import re

Expand Down Expand Up @@ -45,9 +46,9 @@ def test_unknown_libname():
find_nvidia_header_directory("unknown-libname")


def test_find_libname_nvshmem(info_summary_append):
def test_find_libname_nvshmem():
hdr_dir = find_nvidia_header_directory("nvshmem")
info_summary_append(f"{hdr_dir=!r}")
logging.info(f"{hdr_dir=!r}")
if IS_WINDOWS:
assert hdr_dir is None
pytest.skip("nvshmem has no Windows support.")
Expand All @@ -70,9 +71,9 @@ def test_supported_headers_site_packages_ctk_consistency():


@pytest.mark.parametrize("libname", SUPPORTED_HEADERS_CTK.keys())
def test_find_ctk_headers(info_summary_append, libname):
def test_find_ctk_headers(libname):
hdr_dir = find_nvidia_header_directory(libname)
info_summary_append(f"{hdr_dir=!r}")
logging.info(f"{hdr_dir=!r}")
if hdr_dir:
assert os.path.isdir(hdr_dir)
h_filename = SUPPORTED_HEADERS_CTK[libname]
Expand Down
7 changes: 4 additions & 3 deletions cuda_pathfinder/tests/test_load_nvidia_dynamic_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

import functools
import json
import logging
import os
from unittest.mock import patch

Expand Down Expand Up @@ -93,7 +94,7 @@ def _get_libnames_for_test_load_nvidia_dynamic_lib():


@pytest.mark.parametrize("libname", _get_libnames_for_test_load_nvidia_dynamic_lib())
def test_load_nvidia_dynamic_lib(info_summary_append, libname):
def test_load_nvidia_dynamic_lib(libname):
# We intentionally run each dynamic library operation in a child process
# to ensure isolation of global dynamic linking state (e.g., dlopen handles).
# Without child processes, loading/unloading libraries during testing could
Expand All @@ -110,8 +111,8 @@ def raise_child_process_failed():
if result.stdout.startswith("CHILD_LOAD_NVIDIA_DYNAMIC_LIB_HELPER_DYNAMIC_LIB_NOT_FOUND_ERROR:"):
if STRICTNESS == "all_must_work":
raise_child_process_failed()
info_summary_append(f"Not found: {libname=!r}")
logging.info(f"Not found: {libname=!r}")
else:
abs_path = json.loads(result.stdout.rstrip())
info_summary_append(f"abs_path={quote_for_shell(abs_path)}")
logging.info(f"abs_path={quote_for_shell(abs_path)}")
assert os.path.isfile(abs_path) # double-check the abs_path
Loading