Skip to content

Commit c59f3cd

Browse files
rwgkcursoragent
andcommitted
pathfinder: harden compatibility guard rails tests
Skip Linux-only driver-forward-compatibility tests on non-Linux hosts and stop treating nvcc discovery as mandatory in see_what_works real-host checks. This keeps platform-specific expectations from obscuring real guard-rails regressions when CI infrastructure and host layouts vary. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 6b4d910 commit c59f3cd

1 file changed

Lines changed: 19 additions & 2 deletions

File tree

cuda_pathfinder/tests/test_compatibility_guard_rails.py

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
import importlib
55
import os
6+
import sys
67
from pathlib import Path
78

89
import pytest
@@ -370,6 +371,10 @@ def test_driver_compatibility_override_is_linux_only(monkeypatch):
370371
pathfinder.find_nvidia_binary_utility("nvcc")
371372

372373

374+
@pytest.mark.skipif(
375+
not sys.platform.startswith("linux"),
376+
reason="driver forward-compatibility override is Linux-only",
377+
)
373378
def test_public_driver_mismatch_advertises_forward_compatibility_override(monkeypatch, tmp_path):
374379
ctk_root = tmp_path / "cuda-13.0"
375380
_write_cuda_h(ctk_root, "13.0.20251003")
@@ -396,6 +401,10 @@ def fail_raw_fallback(_libname: str) -> LoadedDL:
396401
assert "does not relax CTK-coherence checks" in message
397402

398403

404+
@pytest.mark.skipif(
405+
not sys.platform.startswith("linux"),
406+
reason="driver forward-compatibility override is Linux-only",
407+
)
399408
def test_public_driver_mismatch_falls_back_when_assuming_forward_compatibility(monkeypatch, tmp_path):
400409
ctk_root = tmp_path / "cuda-13.0"
401410
_write_cuda_h(ctk_root, "13.0.20251003")
@@ -420,6 +429,10 @@ def test_public_driver_mismatch_falls_back_when_assuming_forward_compatibility(m
420429
assert loaded is raw_loaded
421430

422431

432+
@pytest.mark.skipif(
433+
not sys.platform.startswith("linux"),
434+
reason="driver forward-compatibility override is Linux-only",
435+
)
423436
def test_forward_compatibility_override_does_not_relax_ctk_coherence_checks(monkeypatch, tmp_path):
424437
lib_root = tmp_path / "cuda-12.8"
425438
hdr_root = tmp_path / "cuda-12.9"
@@ -1232,8 +1245,12 @@ def test_real_wheel_ctk_items_are_compatible(info_summary_append):
12321245
# nvcc found elsewhere, e.g. /usr/local or Conda.
12331246
_assert_real_ctk_backed_path(nvcc)
12341247
else:
1235-
assert nvcc is not None
1236-
_assert_real_ctk_backed_path(nvcc)
1248+
if nvcc is None:
1249+
if STRICTNESS == "all_must_work":
1250+
raise AssertionError("Expected CTK-backed nvcc to be discoverable.")
1251+
info_summary_append("real CTK-backed nvcc executable not found; continuing without asserting nvcc")
1252+
else:
1253+
_assert_real_ctk_backed_path(nvcc)
12371254

12381255

12391256
@pytest.mark.usefixtures("clear_real_host_probe_caches")

0 commit comments

Comments
 (0)