Skip to content

PR Pipeline | Enable LocalDB Tests#4444

Open
benrr101 wants to merge 8 commits into
mainfrom
dev/russellben/pr-localdb
Open

PR Pipeline | Enable LocalDB Tests#4444
benrr101 wants to merge 8 commits into
mainfrom
dev/russellben/pr-localdb

Conversation

@benrr101

@benrr101 benrr101 commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Description

As it turns out, the LocalDB tests were not being executed in the new sqlclient-pr pipeline. This is because the LocalDB tests require the localdb app names to be populated in config AND the supportsIntegratedAuth flag to be set to true. However, the supportsIntegratedAuth was being set to false because the connection strings for azure and localhost tests did not use integrated auth (azure uses managed identity, localhost uses username/password). The supportsIntegratedAuth flag is also mingled with other test such that just setting it to true causes failures with the aforementioned connection strings.

To resolve this and enable localdb testing, I've updated the test stages to include a separate run of manual test project with the connection strings left blank and the supportsIntegratedAuth set to true. This adds an extra 5-7min job to the stage which runs in parallel.

To enable this, I had to also modify some existing tests. There were some tests that would fail if the connection strings were empty. These fell into a couple categories:

  • Tests that had the AreConnStringsSetup conditional theory, but had member/class data that generated 1+ test cases per connection string. Since there were no connection strings, no tests were generated, resulting in a "no data available" test failure. Fixed by disabling enumeration at discovery (comments explaining why were wadded).
  • Tests that relied on a connection string but did not have the AreConnStringsSetup. Most of these had some other condition that implied a connection (eg, IsNotAzureSynapse) but due to the implementation ended up being evaluated as true (eg, !IsAzureSynapse which boils down to a check of null == 6, which meant !false which is true). Fixed by adding the AreConnStringsAdded condition.

In retrospect, it's possible that we could get localdb tests running as part of the azure manual test run. The error that came from enabling supportsIntegratedAuth was due to the connection string being parsed for password fields. Since they do not exist on the azure connection strings, maybe they'd work for localdb testing.

Testing

@benrr101 benrr101 added this to the 7.1.0-preview3 milestone Jul 13, 2026
@benrr101 benrr101 requested a review from a team as a code owner July 13, 2026 19:39
Copilot AI review requested due to automatic review settings July 13, 2026 19:39
@benrr101 benrr101 added Area\Tests Issues that are targeted to tests or test projects Area\Engineering Use this for issues that are targeted for changes in the 'eng' folder or build systems. labels Jul 13, 2026
@github-project-automation github-project-automation Bot moved this to To triage in SqlClient Board Jul 13, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 updates the PR-validation pipeline to reliably execute LocalDB manual tests by adding a dedicated “localdb” manual test run (with blank connection strings and SupportsIntegratedSecurity=true) and adjusting a subset of manual tests to avoid discovery-time failures when connection strings are not configured.

Changes:

  • Add a separate Windows-only PR pipeline job to run TestSqlClientManual against LocalDB (blank TCP/NP connection strings + integrated security enabled), in parallel with existing localhost/azure runs.
  • Thread new pipeline parameters (enableLocalDB, supportsIntegratedSecurity, LocalDB names) through PR pipeline templates and write them into config.jsonc.
  • Update several ManualTests theories to guard on AreConnStringsSetup and disable discovery enumeration for MemberData to avoid “no data found” failures when connection strings are empty.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/ParameterTest/ParametersTest.cs Refactors scaled-decimal theory data generation and switches to ConditionalTheory/MemberData patterns for empty-conn-string scenarios.
src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/ParameterTest/OutputParameterTests.cs Adds AreConnStringsSetup gating to avoid running when no connection strings are configured.
src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/MARSSessionPoolingTest/MarsSessionPoolingTest.cs Adds AreConnStringsSetup gating to avoid running when no connection strings are configured.
src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/DataStreamTest/DataStreamTest.cs Disables discovery enumeration for connection-string-driven MemberData to prevent empty data set failures.
src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/DataStreamTest/CancellationTokenSourceDisposalTest.cs Disables discovery enumeration for connection-string-driven MemberData to prevent empty data set failures.
eng/pipelines/pr/steps/configure-sqlserver-windows-step.yml Adds conditional LocalDB enable/share/start step (parameter-driven).
eng/pipelines/pr/steps/configure-sqlserver-step.yml Threads LocalDB-related parameters into Windows SQL Server configuration step.
eng/pipelines/pr/stages/test-stages.yml Adds the new Windows-only LocalDB manual test job and sets integrated security flags per test configuration.
eng/pipelines/pr/jobs/test-sqlclientmanual-job.yml Adds enableLocalDB + supportsIntegratedSecurity parameters and writes SupportsIntegratedSecurity into generated config.jsonc.

…but it didn't matter b/c the test was marked as flaky.
Copilot AI review requested due to automatic review settings July 13, 2026 21:40

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 9 out of 9 changed files in this pull request and generated no new comments.

mdaigle
mdaigle previously approved these changes Jul 13, 2026
Comment thread eng/pipelines/pr/stages/test-stages.yml
apoorvdeshmukh
apoorvdeshmukh previously approved these changes Jul 14, 2026
@codecov

codecov Bot commented Jul 14, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 64.12%. Comparing base (fdebcd2) to head (c4a91e0).
⚠️ Report is 11 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4444      +/-   ##
==========================================
- Coverage   65.83%   64.12%   -1.72%     
==========================================
  Files         287      284       -3     
  Lines       43763    66786   +23023     
==========================================
+ Hits        28812    42827   +14015     
- Misses      14951    23959    +9008     
Flag Coverage Δ
CI-SqlClient ?
PR-SqlClient-Project 64.12% <ø> (?)

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

☔ View full report in Codecov by Harness.
📢 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.

Copilot AI review requested due to automatic review settings July 14, 2026 16:38
@benrr101 benrr101 dismissed stale reviews from apoorvdeshmukh and mdaigle via c4a91e0 July 14, 2026 16:38
@benrr101 benrr101 moved this from To triage to In review in SqlClient Board Jul 14, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 9 out of 9 changed files in this pull request and generated no new comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area\Engineering Use this for issues that are targeted for changes in the 'eng' folder or build systems. Area\Tests Issues that are targeted to tests or test projects

Projects

Status: In review

Development

Successfully merging this pull request may close these issues.

5 participants