-
Notifications
You must be signed in to change notification settings - Fork 27
Commit c7e3a0c
authored
FEAT: Build Pipeline using docker for Linux multi-distro builds (#124)
### ADO Work Item Reference
<!-- Insert your ADO Work Item ID below (e.g. AB#37452) -->
>
[AB#37852](https://sqlclientdrivers.visualstudio.com/c6d89619-62de-46a0-8b46-70b92a84d85e/_workitems/edit/37852)
-------------------------------------------------------------------
### Summary
<!-- Insert your Copilot Generated Summary below -->
This pull request introduces several updates across multiple files,
focusing on reactivating and improving test pipelines, enhancing cursor
and connection management in the `mssql_python` module, and refining
stored procedure handling in tests. Key changes include reactivating
pytests in build pipelines, implementing robust cursor cleanup
mechanisms, and modifying test cases for improved reliability and naming
conventions.
### Updates to Build Pipelines:
* **Reactivation of Pytests in Build Pipelines**: Reactivated previously
commented-out pytest steps in the `eng/pipelines/build-whl-pipeline.yml`
file to validate bindings and ensure build correctness. This includes
running pytests on different architectures and environments.
[[1]](diffhunk://#diff-a871d64acfb78366b4b077045db53551c2df7d622854569f5f6780ad2ec6f911L135-R145)
[[2]](diffhunk://#diff-a871d64acfb78366b4b077045db53551c2df7d622854569f5f6780ad2ec6f911L322-R326)
[[3]](diffhunk://#diff-a871d64acfb78366b4b077045db53551c2df7d622854569f5f6780ad2ec6f911L543-R558)
### Enhancements to Cursor and Connection Management:
* **Weak Reference-Based Cursor Tracking**: Introduced a `WeakSet` in
`mssql_python/connection.py` to track cursors without causing memory
leaks. This ensures cursors are automatically cleaned up when no longer
in use.
[[1]](diffhunk://#diff-29bb94de45aae51c23a6426d40133c28e4161e68769e08d046059c7186264e90L8-R8)
[[2]](diffhunk://#diff-29bb94de45aae51c23a6426d40133c28e4161e68769e08d046059c7186264e90R57-R69)
* **Improved Connection Cleanup**: Enhanced the `close` method to ensure
all associated cursors are closed before the connection itself is
closed, preventing resource leaks and potential segmentation faults.
* **New Unit Tests for Cursor Management**: Added comprehensive tests in
`tests/test_003_connection.py` to verify cursor cleanup, weak reference
behavior, and proper handling of closed connections.
### Modifications to Stored Procedure Tests:
* **Namespace Refinement**: Updated stored procedure names in
`tests/test_004_cursor.py` to include the `dbo` schema for consistency
and clarity.
[[1]](diffhunk://#diff-82594712308ff34afa8b067af67db231e9a1372ef474da3db121e14e4d418f69L873-R879)
[[2]](diffhunk://#diff-82594712308ff34afa8b067af67db231e9a1372ef474da3db121e14e4d418f69L895-R895)
[[3]](diffhunk://#diff-82594712308ff34afa8b067af67db231e9a1372ef474da3db121e14e4d418f69L907-R907)
[[4]](diffhunk://#diff-82594712308ff34afa8b067af67db231e9a1372ef474da3db121e14e4d418f69L918-R918)
* **Temporary Table Usage**: Replaced persistent table names with
temporary table names (e.g., `#pytest_row_attr_test`) in test cases to
avoid conflicts and ensure isolation during testing.
[[1]](diffhunk://#diff-82594712308ff34afa8b067af67db231e9a1372ef474da3db121e14e4d418f69L1153-R1153)
[[2]](diffhunk://#diff-82594712308ff34afa8b067af67db231e9a1372ef474da3db121e14e4d418f69L1164-R1170)
[[3]](diffhunk://#diff-82594712308ff34afa8b067af67db231e9a1372ef474da3db121e14e4d418f69L1192-R1231)
[[4]](diffhunk://#diff-82594712308ff34afa8b067af67db231e9a1372ef474da3db121e14e4d418f69L1240-R1240)
### Removal of Deprecated Steps:
* **Python Version Task Removal**: Removed outdated `UsePythonVersion@0`
tasks from `eng/pipelines/pr-validation-pipeline.yml`, simplifying
pipeline configuration.
[[1]](diffhunk://#diff-296c8f902bbd70f34ee1c8c32383c8c99165fe4c8e5b0f234f8f22246e56a621L179-L184)
[[2]](diffhunk://#diff-296c8f902bbd70f34ee1c8c32383c8c99165fe4c8e5b0f234f8f22246e56a621L386-L391)
<!--
### 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 release related changes, without any feature changes
RELEASE: #<RELEASE_VERSION> (short-description)
-->1 parent a9632fb commit c7e3a0cCopy full SHA for c7e3a0c
File tree
Expand file treeCollapse file tree
2 files changed
+702
-244
lines changedOpen diff view settings
Filter options
- eng/pipelines
Expand file treeCollapse file tree
2 files changed
+702
-244
lines changedOpen diff view settings
0 commit comments