-
Notifications
You must be signed in to change notification settings - Fork 314
Fix unique db object name issues #3597
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Fixed the unique name generators to: - Keep max lengths to 30 and 96 characters respectively. - Ensure uniqueness at the start of the names.
- Increased long name suffix to 32 characters.
There was a problem hiding this 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 fixes unique database object name generation in the SqlClient test suite to resolve maximum length issues and ensure proper uniqueness. The changes update various test files to use new naming methods (GetShortName
and GetLongName
) instead of the deprecated GetUniqueName
and GetUniqueNameForSqlServer
methods.
- Updates name generators to maintain maximum lengths of 30 and 96 characters respectively
- Replaces deprecated naming methods across all test files with appropriate alternatives
- Implements new uniqueness generation logic using GUID parts and consistent formatting
Reviewed Changes
Copilot reviewed 32 out of 32 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
DataTestUtility.cs | Core implementation of new GetShortName and GetLongName methods with proper length limits |
VectorTypeBackwardCompatibilityTests.cs | Updated vector test table and procedure names to use GetShortName |
NativeVectorFloat32Tests.cs | Updated vector test names to use GetShortName |
Multiple UdtTest files | Updated UDT test names to use GetLongName for tables and procedures |
Multiple SqlBulkCopyTest files | Updated bulk copy test names to use appropriate naming methods |
Multiple other test files | Systematic replacement of deprecated naming methods across test suite |
src/Microsoft.Data.SqlClient/tests/ManualTests/DataCommon/DataTestUtility.cs
Outdated
Show resolved
Hide resolved
…TestUtility.cs Co-authored-by: Copilot <[email protected]>
- Replaced range operators with Substring() since .NET Framework doesn't have ranges.
src/Microsoft.Data.SqlClient/tests/ManualTests/DataCommon/DataTestUtility.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/tests/ManualTests/DataCommon/DataTestUtility.cs
Outdated
Show resolved
Hide resolved
- Replaced '-' with '_' to avoid T-SQL syntax issues.
src/Microsoft.Data.SqlClient/tests/ManualTests/DataCommon/DataTestUtility.cs
Outdated
Show resolved
Hide resolved
- Swapped the suffix into a prefix. - Added debugging to see what the names look like when failures occur.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commentary for myself.
src/Microsoft.Data.SqlClient/tests/ManualTests/DataCommon/DataTestUtility.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/tests/ManualTests/DataCommon/DataTestUtility.cs
Outdated
Show resolved
Hide resolved
- Removed debugging console emission, since it breaks fragile tests! - Added link to database identifier syntax.
/azp run |
Azure Pipelines successfully started running 2 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 2 pipeline(s). |
src/Microsoft.Data.SqlClient/tests/ManualTests/DataCommon/DataTestUtility.cs
Show resolved
Hide resolved
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3597 +/- ##
==========================================
+ Coverage 65.48% 66.31% +0.82%
==========================================
Files 275 275
Lines 61518 61518
==========================================
+ Hits 40288 40797 +509
+ Misses 21230 20721 -509
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Description