Skip to content

CHORE: Exclude vendored simdutf sources from coverage report#579

Open
bewithgaurav wants to merge 5 commits into
microsoft:mainfrom
bewithgaurav:fix-codecov-simdutf-noise
Open

CHORE: Exclude vendored simdutf sources from coverage report#579
bewithgaurav wants to merge 5 commits into
microsoft:mainfrom
bewithgaurav:fix-codecov-simdutf-noise

Conversation

@bewithgaurav
Copy link
Copy Markdown
Collaborator

@bewithgaurav bewithgaurav commented May 14, 2026

Work Item / Issue Reference

AB#45090


Summary

PR #526 dropped overall coverage from 79% to 25% by pulling simdutf in via FetchContent. clang's coverage instrumentation walks mssql_python/pybind/build/_deps/simdutf-src/ and counts 70 vendored files (haswell, westmere, arm64, fallback SIMD variants) where only one dispatches per CPU. the rest sit at 0% forever and tank the denominator.

fix: extend the llvm-cov ignore-filename-regex in generate_codecov.sh with build/_deps/, plus lcov --remove '*/build/_deps/*' after merge as defense-in-depth for future deps.

verified in an ubuntu:22.04 container matching the CI runner:

  • before: 79 cpp sources in report, 70 of them simdutf
  • after: 9 cpp sources, 0 simdutf, all owned by mssql-python

PR microsoft#526 added simdutf as a FetchContent dependency. CMake places its
sources at mssql_python/pybind/build/_deps/simdutf-src/ at build time,
and clang's coverage instrumentation picks them up because they get
linked into ddbc_bindings.so. The current ignore-filename-regex in
generate_codecov.sh excludes Python headers, pybind11, and system
includes, but not _deps/.

This adds two layers of filtering:

1. Primary: extend the llvm-cov ignore-filename-regex with build/_deps/
   so simdutf (and any future FetchContent dependency) is dropped at the
   C++ export step.

2. Defense-in-depth: lcov --remove '*/build/_deps/*' after the
   python + cpp merge, to catch anything that slips through the primary
   filter in future dependencies.

Verified locally in an ubuntu:22.04 container matching the CI image:

- Before: 79 cpp sources in coverage report, 70 of them simdutf
- After:  9 cpp sources, all owned by mssql-python

mssql-python's own coverage numbers are unchanged. The "Files Needing
Attention" list no longer surfaces simdutf SIMD dispatch variants that
inherently run at 0% on a single CI runner (haswell, westmere, arm64,
etc are all built into the same .so but only one variant executes per
CPU).

Co-authored-by: Copilot <[email protected]>
Copilot AI review requested due to automatic review settings May 14, 2026 14:44
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Excludes vendored simdutf sources (pulled in via CMake FetchContent in PR #526) from the C++ coverage report so they don't dilute the coverage percentage.

Changes:

  • Extend llvm-cov -ignore-filename-regex to include build/_deps/.
  • Add a follow-up lcov --remove '*/build/_deps/*' step after merging Python and C++ coverage as defense-in-depth.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 15, 2026

📊 Code Coverage Report

🔥 Diff Coverage

100%


🎯 Overall Coverage

79%


📈 Total Lines Covered: 6799 out of 8570
📁 Project: mssql-python


Diff Coverage

Diff: main...HEAD, staged and unstaged changes

No lines with coverage information in this diff.


📋 Files Needing Attention

📉 Files with overall lowest coverage (click to expand)
mssql_python.pybind.logger_bridge.cpp: 59.2%
mssql_python.pybind.ddbc_bindings.h: 59.7%
mssql_python.row.py: 70.5%
mssql_python.pybind.logger_bridge.hpp: 70.8%
mssql_python.pybind.ddbc_bindings.cpp: 74.2%
mssql_python.__init__.py: 77.3%
mssql_python.pybind.connection.connection.cpp: 77.6%
mssql_python.ddbc_bindings.py: 79.6%
mssql_python.connection.py: 85.3%
mssql_python.logging.py: 85.5%

🔗 Quick Links

⚙️ Build Summary 📋 Coverage Details

View Azure DevOps Build

Browse Full Coverage Report

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.

4 participants