Skip to content

test(cuda.core): isolate build-dir tests from coverage mode - #3354

Open
rluo8 wants to merge 2 commits into
NVIDIA:mainfrom
rluo8:fix/coverage-build-hooks-test-mode
Open

rluo8 wants to merge 2 commits into
NVIDIA:mainfrom
rluo8:fix/coverage-build-hooks-test-mode

Conversation

@rluo8

@rluo8 rluo8 commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Description

The two TestGeneratedSourceDirIsKeyed tests fail in coverage CI on both Linux and Windows (example run). They expect Cython's generated-source directory to be configuration-specific and absolute, but coverage builds intentionally set build_dir="." so generated sources can be packaged.

Set build_hooks.COMPILE_FOR_COVERAGE to False in each test, making their intended regular-build precondition explicit. This does not change build behavior or coverage instrumentation.

Validation

  • Ran cuda_core/tests/test_build_hooks.py --noconftest on Windows with CUDA_PYTHON_COVERAGE=0 and =1: 101 passed, 33 skipped in each mode.
  • Ruff check and format check passed.

Signed-off-by: Rui Luo <ruluo@nvidia.com>
@copy-pr-bot

copy-pr-bot Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@rluo8
rluo8 marked this pull request as ready for review November 4, 2026 05:18
@github-actions github-actions Bot added the cuda.core Everything related to the cuda.core module label Nov 4, 2026
@rluo8 rluo8 self-assigned this Nov 4, 2026
@coderabbitai

coderabbitai Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • Tests
    • Updated build-directory tests to run with coverage compilation disabled while continuing to verify CUDA version separation and directory paths.

Two tests disable coverage compilation before checking generated build-directory paths for CUDA 12 and 13. The tests verify directory separation and absolute-path anchoring.

Changes: Build directory tests

Layer / File(s) Summary
Set coverage mode for directory checks
cuda_core/tests/test_build_hooks.py
Both tests set COMPILE_FOR_COVERAGE to False before checking generated build directories. The checks still verify distinct CUDA-major directories and absolute-path anchoring.

Possibly related issues

  • NVIDIA/cuda-python#3344: The issue reports the same two tests failing in coverage CI. This change sets coverage compilation to False in those tests.

Suggested reviewers: juenglin

Change: Other · Severity of issue fixed: Low

Merge Risk: Minimal · up to b02e4

This test-only change introduces no production behavior or material correctness risk.

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

Tip

🎯 Customize your risk assessments

Guide how CodeRabbit assesses merge risk and security architecture risk. Highlight sensitive changes and explain your security boundaries using Merge Risk Instructions and Security Risk Instructions in your review settings. Security architecture risk assessments require the Advanced plan or above.

✅ Automatic approvals, with your rules

Let CodeRabbit approve pull requests once required threads are resolved, pre-merge checks pass, and your risk limits are met. Enable Automatic approvals in review settings, with overrides for teams or file paths.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 4e3d5a9 and b02e415.

Files selected for processing: 1
  • cuda_core/tests/test_build_hooks.py

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

@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

@rluo8
rluo8 requested a review from mdboom November 4, 2026 12:34
@rluo8 rluo8 added this to the cuda.core 1.3.0 milestone Nov 4, 2026
@mdboom
mdboom enabled auto-merge (squash) November 4, 2026 14:00

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cuda.core Everything related to the cuda.core module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants