Skip to content

Commit 666f3cb

Browse files
jahnvi480Copilot
andauthored
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

‎.github/prompts/setup-dev-env.prompt.md‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,9 +228,13 @@ sudo apt-get install -y cmake build-essential python3-dev
228228

229229
**If missing (RHEL/CentOS/Fedora):**
230230
```bash
231-
sudo dnf install -y cmake gcc-c++ python3-devel
231+
sudo dnf install -y cmake gcc-c++ python3-devel glibc-gconv-extra
232232
```
233233

234+
`glibc-gconv-extra` supplies ODBC's iconv conversions for legacy code pages such
235+
as Korean CP949. Minimal UBI/RHEL images omit these modules; install them before
236+
running the encoding tests on either x64 or ARM64.
237+
234238
**If missing (SUSE):**
235239
```bash
236240
sudo zypper install -y cmake gcc-c++ python3-devel

‎eng/pipelines/pr-validation-pipeline.yml‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1338,7 +1338,8 @@ jobs:
13381338
13391339
# Install Python 3.12 (available in RHEL 9.4+) and development tools
13401340
# Note: curl and wget omitted to avoid conflicts with curl-minimal
1341-
dnf install -y python3.12 python3.12-pip python3.12-devel python3.12-libs gnupg2 glibc-devel kernel-headers
1341+
# ODBC needs the extra iconv modules for legacy code pages such as Korean CP949.
1342+
dnf install -y python3.12 python3.12-pip python3.12-devel python3.12-libs gnupg2 glibc-devel glibc-gconv-extra kernel-headers
13421343
dnf install -y gcc gcc-c++ make binutils cmake
13431344
# If that doesn't work, try installing from different repositories
13441345
if ! which gcc; then
@@ -1551,7 +1552,8 @@ jobs:
15511552
15521553
# Install Python 3.12 (available in RHEL 9.4+) and development tools
15531554
# Note: curl and wget omitted to avoid conflicts with curl-minimal
1554-
dnf install -y python3.12 python3.12-pip python3.12-devel python3.12-libs gnupg2 glibc-devel kernel-headers
1555+
# ODBC needs the extra iconv modules for legacy code pages such as Korean CP949.
1556+
dnf install -y python3.12 python3.12-pip python3.12-devel python3.12-libs gnupg2 glibc-devel glibc-gconv-extra kernel-headers
15551557
dnf install -y gcc gcc-c++ make binutils cmake
15561558
# If that doesn't work, try installing from different repositories
15571559
if ! which gcc; then

0 commit comments

Comments
 (0)