-
Notifications
You must be signed in to change notification settings - Fork 317
Tests | Widen SqlVector test criteria, roundtrip additional values in tests #3794
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
base: main
Are you sure you want to change the base?
Tests | Widen SqlVector test criteria, roundtrip additional values in tests #3794
Conversation
|
/azp run |
|
Azure Pipelines successfully started running 2 pipeline(s). |
| /// 'vector' data type. If a connection cannot be established or an error occurs during the query, the method | ||
| /// returns <see langword="false"/>.</remarks> | ||
| /// <returns><see langword="true"/> if the 'vector' data type is supported; otherwise, <see langword="false"/>.</returns> | ||
| public static bool IsSupportedSqlVector() |
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.
Can you convert this into a property, and only query database on its initialization?
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.
Thanks. I've done this (along with IsSupportedDataClassification as you mentioned in the other comment, although I've changed this method's approach slightly to use OBJECT_ID rather than to wait for an error.)
I've also cleaned up the test conditions slightly, since both properties will return false if the TCP connection string is unspecified.
| /// Checks if object SYS.SENSITIVITY_CLASSIFICATIONS exists in SQL Server | ||
| /// </summary> | ||
| /// <returns>True, if target SQL Server supports Data Classification</returns> | ||
| public static bool IsSupportedDataClassification() |
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.
I would also change this to a property and reduce server calls.
These are IsDataClassificationSupported and IsVectorSupported. In the process, removed the attempted caching for IsTDS8Supported. This caching didn't work properly, and never should have - the ctor for CertificateTest changed the certificate for the SQL Server instance, so the cached data could have been out of date.
|
/azp run |
|
Azure Pipelines successfully started running 2 pipeline(s). |
paulmedynski
left a comment
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.
Can we avoid querying the server more than once per DataTestUtility property that you have touched?
src/Microsoft.Data.SqlClient/tests/ManualTests/DataCommon/DataTestUtility.cs
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/tests/ManualTests/DataCommon/DataTestUtility.cs
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/VectorTest/NativeVectorFloat32Tests.cs
Show resolved
Hide resolved
|
@edwardneal - Looks like some conflicts need to be resolved here. |
|
Thanks @paulmedynski, I've just merged. |
|
/azp run |
|
Azure Pipelines successfully started running 2 pipeline(s). |
Description
This PR does two things:
SqlVectortests to be run against a database server which supports thevectortype (not just Azure SQL instances.)float.MinValue, a value which can't be represented cleanly as a float, and negative zero) to demonstrate that they roundtrip, as per my comments on the original PR.Issues
Fixes #3789. Builds on my comments on the original PR #3433.
Testing
SqlVectortests continue to pass against a local SQL 2025 instance and a SQL Azure instance.