-
Notifications
You must be signed in to change notification settings - Fork 332
[SqlClient] Fix test for .NET Framework #2826
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?
[SqlClient] Fix test for .NET Framework #2826
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
✅ All tests successful. No failed tests found. Additional details and impacted files@@ Coverage Diff @@
## main #2826 +/- ##
===========================================
+ Coverage 73.91% 87.82% +13.91%
===========================================
Files 267 9 -258
Lines 9615 460 -9155
===========================================
- Hits 7107 404 -6703
+ Misses 2508 56 -2452
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
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
Updates the SqlClient integration tests to handle differing stored-procedure behavior between .NET Framework and .NET by adjusting the InlineData parameters under conditional compilation.
- Added
#if NETFRAMEWORK
/#else
around stored-procedure InlineData to use a null expected operation name on .NET Framework - Split and adjusted test data for each framework case
Comments suppressed due to low confidence (2)
test/OpenTelemetry.Instrumentation.SqlClient.Tests/SqlClientIntegrationTests.cs:32
- Add a brief comment above this conditional block explaining why .NET Framework uses a null expected operation name, so future maintainers understand the behavioral difference.
#if NETFRAMEWORK
test/OpenTelemetry.Instrumentation.SqlClient.Tests/SqlClientIntegrationTests.cs:33
- [nitpick] Add tests for toggling other flags (e.g., statement collection or parameter inclusion) in the stored-procedure scenario, similar to the text-command cases, to ensure consistent test coverage.
[InlineData(CommandType.StoredProcedure, "sp_who", false, null)]
test/OpenTelemetry.Instrumentation.SqlClient.Tests/SqlClientIntegrationTests.cs
Show resolved
Hide resolved
This PR was marked stale due to lack of activity. It will be closed in 7 days. |
fcc4955
to
90e6a77
Compare
@@ -29,7 +29,12 @@ public SqlClientIntegrationTests(SqlClientIntegrationTestsFixture fixture) | |||
[InlineData(CommandType.Text, "select 1/0", false, null, true)] | |||
[InlineData(CommandType.Text, "select 1/0", false, null, true, false, false)] | |||
[InlineData(CommandType.Text, "select 1/0", false, null, true, true, false)] | |||
#if NETFRAMEWORK | |||
[InlineData(CommandType.StoredProcedure, "sp_who", false, null)] | |||
#else | |||
[InlineData(CommandType.StoredProcedure, "sp_who", false, "sp_who")] |
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.
Does this test fail on NetFx ?
I'm trying to determine if we have problem with the CI.
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.
Before the fix, it failed 100% of the time on my laptop, which is how I found it.
I did have a similar thought as to why CI wasn't failing, but I couldn't see anything obvious that explained it.
Update test cases for different behaviour between .NET Framework and .NET.
Avoid duplicated row.
90e6a77
to
0d456ae
Compare
Changes
Update test cases for different behaviour between .NET Framework and .NET.
Discovered after I ran
dotnet test
on my Windows 11 machine.Merge requirement checklist
CHANGELOG.md
files updated for non-trivial changes