Skip to content

Conversation

edwardneal
Copy link
Contributor

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.

@edwardneal edwardneal requested a review from a team as a code owner June 16, 2025 17:19
@cheenamalhotra cheenamalhotra added the Area\Tests Issues that are targeted to tests or test projects label Jun 16, 2025
@cheenamalhotra
Copy link
Member

/azp run

Copy link

Azure Pipelines successfully started running 2 pipeline(s).

Copy link
Contributor

@paulmedynski paulmedynski left a 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.

paulmedynski
paulmedynski previously approved these changes Jun 25, 2025
@paulmedynski
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 2 pipeline(s).

paulmedynski
paulmedynski previously approved these changes Jun 27, 2025
@paulmedynski
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 2 pipeline(s).

Copy link

codecov bot commented Jul 2, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 61.16%. Comparing base (1765de5) to head (a868f5e).
⚠️ Report is 3 commits behind head on main.

❗ There is a different number of reports uploaded between BASE (1765de5) and HEAD (a868f5e). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (1765de5) HEAD (a868f5e)
addons 1 0
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     
Flag Coverage Δ
addons ?
netcore 64.27% <ø> (-9.03%) ⬇️
netfx 63.08% <ø> (-5.17%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@edwardneal
Copy link
Contributor Author

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?

paulmedynski
paulmedynski previously approved these changes Jul 21, 2025
@mdaigle mdaigle self-assigned this Aug 26, 2025
@paulmedynski paulmedynski self-assigned this Aug 28, 2025
Copy link
Contributor

@benrr101 benrr101 left a 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

* Switch to using TheoryData
* Nit: => movement
* Rename tests
* Split delegate for Assert.Throws into separate arrange/act/assert segment of each method
Copy link
Contributor

@benrr101 benrr101 left a 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 :)

paulmedynski
paulmedynski previously approved these changes Sep 12, 2025
@paulmedynski
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@paulmedynski
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 2 pipeline(s).

paulmedynski
paulmedynski previously approved these changes Sep 16, 2025
@benrr101 benrr101 self-assigned this Sep 16, 2025
Copy link
Contributor

@benrr101 benrr101 left a 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.

@paulmedynski
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 2 pipeline(s).

Copy link
Contributor

@benrr101 benrr101 left a 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 👍

@benrr101 benrr101 merged commit 2655083 into dotnet:main Sep 18, 2025
236 checks passed
@edwardneal edwardneal deleted the feat/udt-serialization/tests branch September 18, 2025 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area\Tests Issues that are targeted to tests or test projects

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants