Repository navigation
Test | Fix pool reflection in tests - #3379
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR fixes issues with test failures by correcting the reflection usage to access pool properties in authentication tests.
- Changed reflection binding flags for "AuthenticationContexts" from non-public to public.
- Ensured that tests now correctly access the intended property using the updated API.
Comments suppressed due to low confidence (1)
src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/Common/SystemDataInternals/FedAuthTokenHelper.cs:99
- The change from BindingFlags.NonPublic to BindingFlags.Public indicates an adjustment to access a now public member. Please confirm that this update aligns with the overall API design and that any related documentation has been updated accordingly.
IEnumerable authenticationContexts = (IEnumerable)databaseConnectionPoolObj.GetType().GetProperty("AuthenticationContexts", BindingFlags.Public | BindingFlags.Instance).GetValue(databaseConnectionPoolObj, null);
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3379 +/- ##
==========================================
- Coverage 67.04% 64.45% -2.59%
==========================================
Files 300 298 -2
Lines 65376 65525 +149
==========================================
- Hits 43831 42236 -1595
- Misses 21545 23289 +1744
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:
|
David-Engel
approved these changes
May 27, 2025
paulmedynski
approved these changes
May 27, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
My last PR ran as a forked build and so missed some tests that use reflection to access pool properties. This PR corrects the issue and runs as a branch build to ensure full coverage.
Issues
Fixes test failures due to #3352
Testing
Runs full test suite (including branch-build-only tests)
Guidelines
Please review the contribution guidelines before submitting a pull request: