Add unit tests to raise coverage in mssql-odbc and mssql-py-core - #132
Draft
Saurabh Singh (saurabh500) wants to merge 1 commit into
Draft
Add unit tests to raise coverage in mssql-odbc and mssql-py-core#132Saurabh Singh (saurabh500) wants to merge 1 commit into
Saurabh Singh (saurabh500) wants to merge 1 commit into
Conversation
Cover FFI null/state paths in mssql-odbc (exports, more_results, exec_direct, disconnect) and pure logic in mssql-py-core (row_writer write_* impls, types validate_type_compatibility). No production changes. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 65394310-2a36-4e2d-80fa-1adff74cd509
📊 Code Coverage Report
Diff CoverageDiff: main...HEAD, staged and unstaged changesNo lines with coverage information in this diff. 🔗 Quick Links |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Follow-up to the coverage-reporting change: adds high-value unit tests (no coverage-tooling/CI changes) to the two under-covered Rust crates. All additions are
#[cfg(test)]inline modules exercising pure logic and FFI null/state paths that need no live SQL Server, network, or real ODBC DSN. No production code changed (428 insertions, 0 deletions).Coverage (line rate, own
src/**only)Modules covered
mssql-odbc (
cargo llvm-cov nextest --package mssql-odbc; 269 tests pass)api/exports.rs— 0% → 100%: every exportedSQL*entry point (null-handle →SQL_INVALID_HANDLE, stubs →SQL_SUCCESS, env alloc/free).api/more_results.rs— 0% → ~55%: null handle, no-cursor →SQL_NO_DATA, busy-other-statement, no-active-client branches.api/exec_direct.rs— 41% → 58%: connected-but-no-client and busy-other-statement error paths.api/disconnect.rs— 73% → 88%: connected → disconnect success path.mssql-py-core (nextest via the Linux build image; 96 tests pass)
row_writer.rs— 0% → 94%: allRowWriter::write_*impls asserting accumulatedColumnValues.types.rs— 18.66% → 29.29%:validate_type_compatibilitycompatible/mismatch/Variant/Null match arms.Tests follow existing sibling
#[cfg(test)]conventions and the repo's terse style.Related Issues
N/A — no GitHub issue or Azure DevOps work item was provided for this follow-up.
Checklist
cargo bfmtpasses (workspace; py-corecargo fmt --checkconfirmed in the Linux build image)cargo bclippypasses (workspace + py-core,-D warningsclean)cargo btestpasses (odbc 269 tests; py-core 96 tests via the build image)