Skip to content

Do code coverage per pr, not in merge queue#4511

Open
mitchdz wants to merge 2 commits into
NVIDIA:mainfrom
mitchdz:do-code-coverage-per-pr
Open

Do code coverage per pr, not in merge queue#4511
mitchdz wants to merge 2 commits into
NVIDIA:mainfrom
mitchdz:do-code-coverage-per-pr

Conversation

@mitchdz
Copy link
Copy Markdown
Collaborator

@mitchdz mitchdz commented May 13, 2026

No description provided.

mitchdz added 2 commits May 13, 2026 04:44
…ld on PR

Three coordinated changes so coverage runs on every PR (the runs that
actually benefit reviewers) while staying off the critical path:

1. ci.yml gen_code_coverage gate flipped from "!= push" to
   "!= merge_group". Coverage now runs on PR push, schedule, and
   dispatch — but not on the merge queue, where coverage-instrumented
   builds would just lengthen the critical path without adding signal
   (build_and_test already covers correctness on the same toolchains).

2. generate_cc.yml gains a `coverage_flags` input forwarded as a
   Dockerfile build-arg. ci.yml passes "-v -c" on PR push (C++ coverage
   only) and "-v -c -p" on schedule + dispatch (full coverage). Skipping
   the Python pass on PR avoids the _skbuild rebuild + pytest-with-cov
   run that adds 10-20 min — keeping coverage shorter than the
   build_and_test critical path.

3. cudaq.dev.Dockerfile coverage stage now reads $coverage_flags and
   touches build/pycoverage/coverage.xml so the coverage-export COPY
   succeeds whether Python coverage ran or not. The codecov upload uses
   fail_ci_if_error: false, so an empty xml on PR runs is silent.

Signed-off-by: mdzurick <mitch_dz@hotmail.com>
Drops the PR-only "-v -c" shortcut and the coverage_flags plumbing
introduced in 400ab89. The gating change stands: coverage still
runs on PR push / schedule / dispatch and is skipped on merge_group.

Partial coverage on PR (C++ only) produces a misleading Codecov delta
because the Python pass is the only thing exercising large parts of
the bindings + frontend. If gen_code_coverage ends up being the
longest leg on PR, address it with more parallelism or a bigger
runner instead of dropping scope.

Signed-off-by: mdzurick <mitch_dz@hotmail.com>
@github-actions
Copy link
Copy Markdown

CI Summary (push) — ✅ passed

Run #25779844669 · ✅ 7 · ⏩ 6 · ❌ 0 · ⛔ 0

Top-level jobs (13)
Job Result
binaries ⏩ skipped
build_and_test ✅ success
config_devdeps ✅ success
config_source_build ⏩ skipped
config_wheeldeps ✅ success
devdeps ✅ success
docker_image ⏩ skipped
gen_code_coverage ✅ success
metadata ✅ success
python_metapackages ⏩ skipped
python_wheels ⏩ skipped
source_build ⏩ skipped
wheeldeps ✅ success
⏩ Skipped jobs (6) — intentionally skipped on PR builds; run on merge_group / workflow_dispatch
Job
binaries
config_source_build
docker_image
python_metapackages
python_wheels
source_build
All sub-jobs (42) — every matrix leg, with links
Job Status Link
Build and test (amd64, gcc12, openmpi) / Dev environment (Debug) ✅ success view
Build and test (amd64, gcc12, openmpi) / Dev environment (Python) ✅ success view
Build and test (amd64, llvm, openmpi) / Dev environment (Debug) ✅ success view
Build and test (amd64, llvm, openmpi) / Dev environment (Python) ✅ success view
Build and test (arm64, llvm, openmpi) / Dev environment (Debug) ✅ success view
Build and test (arm64, llvm, openmpi) / Dev environment (Python) ✅ success view
CI Summary ❔ in_progress view
Configure build (devdeps) ✅ success view
Configure build (source_build) ⏩ skipped view
Configure build (wheeldeps) ✅ success view
Create CUDA Quantum installer ⏩ skipped view
Create Docker images ⏩ skipped view
Create Python metapackages ⏩ skipped view
Create Python wheels ⏩ skipped view
Gen code coverage (amd64) / gen_code_coverage ✅ success view
Load dependencies (amd64, gcc12) / Caching ✅ success view
Load dependencies (amd64, gcc12) / Finalize ✅ success view
Load dependencies (amd64, gcc12) / Metadata ✅ success view
Load dependencies (amd64, llvm) / Caching ✅ success view
Load dependencies (amd64, llvm) / Finalize ✅ success view
Load dependencies (amd64, llvm) / Metadata ✅ success view
Load dependencies (arm64, gcc12) / Caching ✅ success view
Load dependencies (arm64, gcc12) / Finalize ✅ success view
Load dependencies (arm64, gcc12) / Metadata ✅ success view
Load dependencies (arm64, llvm) / Caching ✅ success view
Load dependencies (arm64, llvm) / Finalize ✅ success view
Load dependencies (arm64, llvm) / Metadata ✅ success view
Load source build cache ⏩ skipped view
Load wheel dependencies (amd64, 12.6) / Caching ✅ success view
Load wheel dependencies (amd64, 12.6) / Finalize ✅ success view
Load wheel dependencies (amd64, 12.6) / Metadata ✅ success view
Load wheel dependencies (amd64, 13.0) / Caching ✅ success view
Load wheel dependencies (amd64, 13.0) / Finalize ✅ success view
Load wheel dependencies (amd64, 13.0) / Metadata ✅ success view
Load wheel dependencies (arm64, 12.6) / Caching ✅ success view
Load wheel dependencies (arm64, 12.6) / Finalize ✅ success view
Load wheel dependencies (arm64, 12.6) / Metadata ✅ success view
Load wheel dependencies (arm64, 13.0) / Caching ✅ success view
Load wheel dependencies (arm64, 13.0) / Finalize ✅ success view
Load wheel dependencies (arm64, 13.0) / Metadata ✅ success view
Prepare cache clean-up ❔ in_progress view
Retrieve PR info ✅ success view
✅ Required checks (6/6) — declared in .github/required-checks.yml for push
Required check Status Link
Build and test (amd64, llvm, openmpi) / Dev environment (Debug) ✅ success view
Build and test (amd64, llvm, openmpi) / Dev environment (Python) ✅ success view
Build and test (arm64, llvm, openmpi) / Dev environment (Debug) ✅ success view
Build and test (arm64, llvm, openmpi) / Dev environment (Python) ✅ success view
Build and test (amd64, gcc12, openmpi) / Dev environment (Debug) ✅ success view
Build and test (amd64, gcc12, openmpi) / Dev environment (Python) ✅ success view

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant