-
Notifications
You must be signed in to change notification settings - Fork 315
Tests | Expand UDT serialization code coverage #3423
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
Tests | Expand UDT serialization code coverage #3423
Conversation
/azp run |
Azure Pipelines successfully started running 2 pipeline(s). |
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.
Mostly style questions/comments.
src/Microsoft.Data.SqlClient/tests/UnitTests/Microsoft.Data.SqlClient.UnitTests.csproj
Outdated
Show resolved
Hide resolved
...lClient/tests/UnitTests/Microsoft/Data/SqlClient/UdtSerialization/NativeSerializationTest.cs
Outdated
Show resolved
Hide resolved
....Data.SqlClient/tests/UnitTests/Microsoft/Data/SqlClient/UdtSerialization/SerializedTypes.cs
Outdated
Show resolved
Hide resolved
...Client/tests/UnitTests/Microsoft/Data/SqlClient/UdtSerialization/InvalidSerializationTest.cs
Outdated
Show resolved
Hide resolved
...lClient/tests/UnitTests/Microsoft/Data/SqlClient/UdtSerialization/NativeSerializationTest.cs
Show resolved
Hide resolved
...lClient/tests/UnitTests/Microsoft/Data/SqlClient/UdtSerialization/NativeSerializationTest.cs
Outdated
Show resolved
Hide resolved
...Client/tests/UnitTests/Microsoft/Data/SqlClient/UdtSerialization/InvalidSerializationTest.cs
Outdated
Show resolved
Hide resolved
...lClient/tests/UnitTests/Microsoft/Data/SqlClient/UdtSerialization/NativeSerializationTest.cs
Outdated
Show resolved
Hide resolved
...lClient/tests/UnitTests/Microsoft/Data/SqlClient/UdtSerialization/NativeSerializationTest.cs
Outdated
Show resolved
Hide resolved
...nt/tests/UnitTests/Microsoft/Data/SqlClient/UdtSerialization/UserDefinedSerializationTest.cs
Outdated
Show resolved
Hide resolved
Also enforce this via editorconfig
Also mandating this by generating a documentation XML file
/azp run |
Azure Pipelines successfully started running 2 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 2 pipeline(s). |
Codecov Report✅ All modified and coverable lines are covered by tests.
Additional details and impacted files@@ Coverage Diff @@
## main #3423 +/- ##
==========================================
- Coverage 69.61% 61.16% -8.46%
==========================================
Files 276 270 -6
Lines 61714 61398 -316
==========================================
- Hits 42964 37554 -5410
- Misses 18750 23844 +5094
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:
|
I've merged main, with the unreachable code paths removed. Could someone re-run CI so we can verify the up-to-date coverage please? |
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.
Glad to have more tests! A handful of requests, but nothing too crazy
...lient/tests/UnitTests/Microsoft/Data/SqlClient/ConnectionPool/ChannelDbConnectionPoolTest.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/tests/UnitTests/InternalsVisibleToTest.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/tests/UnitTests/Microsoft.Data.SqlClient.UnitTests.csproj
Outdated
Show resolved
Hide resolved
...lClient/tests/UnitTests/Microsoft/Data/SqlClient/UdtSerialization/NativeSerializationTest.cs
Outdated
Show resolved
Hide resolved
...lClient/tests/UnitTests/Microsoft/Data/SqlClient/UdtSerialization/NativeSerializationTest.cs
Outdated
Show resolved
Hide resolved
...lClient/tests/UnitTests/Microsoft/Data/SqlClient/UdtSerialization/NativeSerializationTest.cs
Outdated
Show resolved
Hide resolved
...lClient/tests/UnitTests/Microsoft/Data/SqlClient/UdtSerialization/NativeSerializationTest.cs
Show resolved
Hide resolved
* Switch to using TheoryData * Nit: => movement * Rename tests * Split delegate for Assert.Throws into separate arrange/act/assert segment of each method
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.
Would still like to see the comment requirement backed out, use of the TheoryData (without analyzer enforcement). The rest is just if you feel like it :)
src/Microsoft.Data.SqlClient/tests/UnitTests/Microsoft.Data.SqlClient.UnitTests.csproj
Outdated
Show resolved
Hide resolved
...lClient/tests/UnitTests/Microsoft/Data/SqlClient/UdtSerialization/NativeSerializationTest.cs
Outdated
Show resolved
Hide resolved
....Data.SqlClient/tests/UnitTests/Microsoft/Data/SqlClient/UdtSerialization/SerializedTypes.cs
Show resolved
Hide resolved
/azp run |
Azure Pipelines successfully started running 2 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 2 pipeline(s). |
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.
Still going to request we remove the requirement for comments on unit tests. And will get back with results of poll for variable declaration style.
/azp run |
Azure Pipelines successfully started running 2 pipeline(s). |
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 for putting up with my requests 👍
Description
I've been looking at a set of performance improvements and code health improvements to the serialization of CLR UDTs - SqlNormalizer.cs and SqlSer.cs. At present though, there isn't sufficient test coverage to prevent regressions. This PR widens that coverage, adding a set of new unit tests for the serialization and deserialization of CLR UDTs. By the end of this, I think we cover every reachable branch.
This is also the first set of additional tests in the new UnitTests project, and the first tests which test current library functionality. I've got no objection if anyone wants to start the new project with a consistent code style.
Issues
None.
Testing
All tests pass, all values match existing behaviour.