Skip to content

Conversation

bewithgaurav
Copy link
Collaborator

@bewithgaurav bewithgaurav commented Sep 17, 2025

Work Item / Issue Reference

AB#38622

GitHub Issue: #<ISSUE_NUMBER>


Summary

This pull request introduces a new workflow for unified code coverage on macOS, enabling combined Python and C++ coverage reports for pull requests. It adds a new GitHub Actions workflow, a coverage generation script, and updates the CMake build configuration to support Clang coverage instrumentation.

CI/CD and Coverage Reporting Improvements:

  • Added a new GitHub Actions workflow .github/workflows/pr-code-coverage.yml to run tests on macOS, build C++ bindings, start a SQL Server container, and generate a unified (Python + C++) coverage report, which is automatically commented on pull requests.
  • Added generate_codecov.sh script to automate the process of collecting, merging, and generating unified HTML coverage reports from both Python and C++ code using LLVM, lcov, and coverage-lcov.

Build System Updates:

  • Updated mssql_python/pybind/build.sh to configure CMake with Clang coverage instrumentation flags (-fprofile-instr-generate -fcoverage-mapping) on macOS, enabling C++ code coverage collection.

@Copilot Copilot AI review requested due to automatic review settings September 17, 2025 05:46
@github-actions github-actions bot added the pr-size: medium Moderate update size label Sep 17, 2025
Copy link
Contributor

@Copilot 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

This PR introduces a comprehensive code coverage solution for the mssql-python project, enabling unified Python and C++ coverage reporting on macOS through GitHub Actions. The implementation adds automated coverage collection, merging, and PR commenting capabilities.

  • Adds a new GitHub Actions workflow for macOS-based unified coverage testing on pull requests
  • Implements a shell script to automate coverage collection, merging Python and C++ coverage data
  • Updates the CMake build configuration to enable Clang coverage instrumentation on macOS

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
.github/workflows/pr-code-coverage.yml New GitHub Actions workflow for running tests and generating unified coverage reports on macOS
generate_codecov.sh New script to collect, merge, and generate HTML coverage reports from Python and C++ code
mssql_python/pybind/build.sh Updated to include Clang coverage flags for C++ instrumentation on macOS

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@github-actions github-actions bot added pr-size: medium Moderate update size and removed pr-size: medium Moderate update size labels Sep 17, 2025
…ain permissions

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@github-actions github-actions bot added pr-size: medium Moderate update size and removed pr-size: medium Moderate update size labels Sep 17, 2025
@github-actions github-actions bot added pr-size: medium Moderate update size and removed pr-size: medium Moderate update size labels Sep 17, 2025
@github-actions github-actions bot added pr-size: medium Moderate update size and removed pr-size: medium Moderate update size labels Sep 17, 2025
@github-actions github-actions bot added pr-size: medium Moderate update size and removed pr-size: medium Moderate update size labels Sep 17, 2025
@github-actions github-actions bot added pr-size: medium Moderate update size and removed pr-size: medium Moderate update size labels Sep 17, 2025
@github-actions github-actions bot added pr-size: medium Moderate update size and removed pr-size: medium Moderate update size labels Sep 17, 2025
@github-actions github-actions bot removed the pr-size: medium Moderate update size label Sep 17, 2025
Copy link

github-actions bot commented Sep 17, 2025

✅ Azure DevOps build completed successfully.
👉 View Full Coverage Report

@github-actions github-actions bot added pr-size: medium Moderate update size and removed pr-size: medium Moderate update size labels Sep 17, 2025
@github-actions github-actions bot added pr-size: medium Moderate update size and removed pr-size: medium Moderate update size labels Sep 17, 2025
@github-actions github-actions bot added pr-size: medium Moderate update size and removed pr-size: medium Moderate update size labels Sep 17, 2025
@github-actions github-actions bot added pr-size: medium Moderate update size and removed pr-size: medium Moderate update size labels Sep 17, 2025
Copy link

github-actions bot commented Sep 17, 2025

📊 Code Coverage Report

🎯 Coverage

71%

📈 Lines Covered: 2970 out of 4182
📁 Project: mssql-python
🔍 Parser: Cobertura


📋 Files Needing Attention

📉 Files with lowest coverage (click to expand)
mssql_python.pybind.ddbc_bindings.cpp: 62.1%
mssql_python.ddbc_bindings.py: 68.5%
mssql_python.pybind.connection.connection_pool.cpp: 78.9%
mssql_python.helpers.py: 84.7%
mssql_python.auth.py: 85.3%

💡 Tip: Focus on improving coverage for these files to boost overall project health


🔗 Quick Links

Build Status 📊 Coverage Details
View Azure DevOps Build Browse Full Coverage Report

🤖 This report was automatically generated from Azure DevOps build artifacts

@github-actions github-actions bot added pr-size: medium Moderate update size and removed pr-size: medium Moderate update size labels Sep 17, 2025
@github-actions github-actions bot added pr-size: medium Moderate update size and removed pr-size: medium Moderate update size labels Sep 17, 2025
@github-actions github-actions bot added pr-size: large Substantial code update and removed pr-size: medium Moderate update size labels Sep 18, 2025
@github-actions github-actions bot added pr-size: large Substantial code update and removed pr-size: large Substantial code update labels Sep 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-size: large Substantial code update
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant