Skip to content

Commit 80b7c48

Browse files
cpcloudcursoragent
andcommitted
refactor(pathfinder): address review feedback on test info logging
- Hardwire log filename with `pathfinder` prefix and `.txt` extension - Retain strictness suffix so both CI runs produce separate logs - Add `pytest_configure` to clean up stale log for the current strictness level (not all levels, preserving the other run's log) - Add line count echo to `run-tests` for quick CI log grep - Add `.gitignore` entry for the new `.txt` log files - Update artifact upload paths in both workflow files - Align default strictness fallback with `test_load_nvidia_dynamic_lib` Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 37044ad commit 80b7c48

File tree

5 files changed

+19
-4
lines changed

5 files changed

+19
-4
lines changed

.github/workflows/test-wheel-linux.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,5 +304,5 @@ jobs:
304304
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
305305
with:
306306
name: cuda-pathfinder-test-info-${{ inputs.host-platform }}-py${{ matrix.PY_VER }}-cuda${{ matrix.CUDA_VER }}-${{ matrix.LOCAL_CTK == '1' && 'local' || 'wheels' }}-${{ matrix.GPU }}
307-
path: cuda_pathfinder/test-info-summary-*.log
307+
path: cuda_pathfinder/pathfinder-test-info-summary-*.txt
308308
if-no-files-found: error

.github/workflows/test-wheel-windows.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,5 +281,5 @@ jobs:
281281
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
282282
with:
283283
name: cuda-pathfinder-test-info-${{ inputs.host-platform }}-py${{ matrix.PY_VER }}-cuda${{ matrix.CUDA_VER }}-${{ matrix.LOCAL_CTK == '1' && 'local' || 'wheels' }}-${{ matrix.GPU }}
284-
path: cuda_pathfinder/test-info-summary-*.log
284+
path: cuda_pathfinder/pathfinder-test-info-summary-*.txt
285285
if-no-files-found: error

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,5 +194,8 @@ cython_debug/
194194
.pixi/*
195195
!.pixi/config.toml
196196

197+
# Pathfinder test info log
198+
pathfinder-test-info-summary-*.txt
199+
197200
# Cursor
198201
.cursorrules

ci/tools/run-tests

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ if [[ "${test_module}" == "pathfinder" ]]; then
3434
"FH:${CUDA_PATHFINDER_TEST_FIND_NVIDIA_HEADERS_STRICTNESS} " \
3535
"BC:${CUDA_PATHFINDER_TEST_FIND_NVIDIA_BITCODE_LIB_STRICTNESS}"
3636
pytest -ra -s -v --durations=0 tests/
37+
echo "Number of \"INFO test_\" lines: $(cat pathfinder-test-info-summary-*.txt | wc -l)"
3738
popd
3839
elif [[ "${test_module}" == "bindings" ]]; then
3940
echo "Installing bindings wheel"

cuda_pathfinder/tests/conftest.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,21 @@
1010
_LOGGER_NAME = "cuda_pathfinder.test_info"
1111

1212

13+
def _log_filename():
14+
strictness = os.environ.get(
15+
"CUDA_PATHFINDER_TEST_LOAD_NVIDIA_DYNAMIC_LIB_STRICTNESS", "see_what_works"
16+
)
17+
return f"pathfinder-test-info-summary-{strictness}.txt"
18+
19+
20+
def pytest_configure(config):
21+
log_path = config.rootpath / _log_filename()
22+
log_path.unlink(missing_ok=True)
23+
24+
1325
@pytest.fixture(scope="session")
1426
def _info_summary_handler(request):
15-
strictness = os.environ.get("CUDA_PATHFINDER_TEST_LOAD_NVIDIA_DYNAMIC_LIB_STRICTNESS", "default")
16-
log_path = request.config.rootpath / f"test-info-summary-{strictness}.log"
27+
log_path = request.config.rootpath / _log_filename()
1728
handler = logging.FileHandler(log_path, mode="w")
1829
handler.setFormatter(logging.Formatter("%(test_node)s: %(message)s"))
1930

0 commit comments

Comments
 (0)