Skip to content

Conversation

@benrr101
Copy link
Contributor

@benrr101 benrr101 commented Jan 7, 2026

Description

Pulling together a few PRs from some test work I did over the holidays. This PR:

  • Moves SqlError tests to the UnitTest project (they are indeed just unit tests)
  • Moves SqlErrorCollection tests to the UnitTest project (they are also just unit tests)
  • Some improvements to the tests.

Issues

N/A

Testing

Tests run locally and seem to work in the draft runs I did previously

@benrr101 benrr101 requested a review from a team as a code owner January 7, 2026 19:24
Copilot AI review requested due to automatic review settings January 7, 2026 19:24
@benrr101 benrr101 added the Area\Tests Issues that are targeted to tests or test projects label Jan 7, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR reorganizes test files by moving SqlError and SqlErrorCollection tests from the FunctionalTests project to the UnitTests project, making them truly isolated unit tests that don't require a SQL Server connection.

  • Migrates SqlError serialization test from FunctionalTests to UnitTests with improved test structure
  • Adds comprehensive SqlErrorCollection unit tests covering collection operations, indexing, enumeration, and copy operations
  • Removes dependency on SQL Server connection for these tests by using internal constructors directly

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
src/Microsoft.Data.SqlClient/tests/UnitTests/Microsoft/Data/SqlClient/SqlErrorTests.cs New unit test file for SqlError with serialization round-trip test
src/Microsoft.Data.SqlClient/tests/UnitTests/Microsoft/Data/SqlClient/SqlErrorCollectionTests.cs New comprehensive unit test file for SqlErrorCollection with tests for Add, CopyTo, GetEnumerator, and Indexer operations
src/Microsoft.Data.SqlClient/tests/FunctionalTests/SqlErrorTest.cs Removes old functional test file that required SQL Server connection
src/Microsoft.Data.SqlClient/tests/FunctionalTests/Microsoft.Data.SqlClient.FunctionalTests.csproj Removes reference to deleted SqlErrorTest.cs file

mdaigle
mdaigle previously approved these changes Jan 13, 2026
Copilot AI review requested due to automatic review settings January 21, 2026 17:33
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

@paulmedynski paulmedynski self-assigned this Jan 21, 2026
paulmedynski
paulmedynski previously approved these changes Jan 21, 2026
@codecov
Copy link

codecov bot commented Jan 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 69.98%. Comparing base (77f79e0) to head (8cb28e2).
⚠️ Report is 2 commits behind head on main.

❗ There is a different number of reports uploaded between BASE (77f79e0) and HEAD (8cb28e2). Click for more details.

HEAD has 4 uploads less than BASE
Flag BASE (77f79e0) HEAD (8cb28e2)
netfx 2 1
netcore 2 1
addons 2 0
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3869      +/-   ##
==========================================
- Coverage   76.90%   69.98%   -6.93%     
==========================================
  Files         269      263       -6     
  Lines       43246    66170   +22924     
==========================================
+ Hits        33260    46308   +13048     
- Misses       9986    19862    +9876     
Flag Coverage Δ
addons ?
netcore 69.99% <ø> (-6.95%) ⬇️
netfx 69.24% <ø> (-7.12%) ⬇️

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.

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