Skip to content

Make SQLite fallback reliable when Docker is unavailable#1073

Open
MartinHock wants to merge 3 commits into
ardalis:mainfrom
MartinHock:issue/1028-reliable-sqlite-fallback
Open

Make SQLite fallback reliable when Docker is unavailable#1073
MartinHock wants to merge 3 commits into
ardalis:mainfrom
MartinHock:issue/1028-reliable-sqlite-fallback

Conversation

@MartinHock

@MartinHock MartinHock commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Make the functional test database provider explicitly selectable.
  • Keep SQL Server through Testcontainers as the preferred provider.
  • Fall back to SQLite only when Docker is unavailable.
  • Use an isolated temporary SQLite database for each test factory.
  • Clean up temporary SQLite database files after the test run.
  • Add tests that verify the SQLite provider and a functional endpoint using SQLite.

Behavior

When Docker is available:

  • SQL Server Testcontainers are used.
  • All functional tests run with SQL Server.
  • The Docker-specific test runs normally.

When Docker is unavailable:

  • The functional test factory falls back to SQLite.
  • The Docker-specific test is skipped.
  • The remaining functional tests continue to pass.

Only DockerUnavailableException triggers the fallback or skipped test. Other container or SQL Server startup errors remain visible as test failures.

Verification

With Docker running:

Total tests: 6
Passed: 6
Failed: 0
Skipped: 0


## Build note

The current upstream branch reports NU1903 for the vulnerable transitive
SQLite dependency and treats all warnings as errors.

This PR keeps NU1903 visible but excludes it from `TreatWarningsAsErrors`
so the functional-test changes can be built and verified.

The actual dependency update is handled separately in #1067.

Updated WarningsNotAsErrors to include NU1903, so this warning is no longer treated as an error during builds. All other build settings remain unchanged.
Added comment and configuration to ensure warning NU1903 (transitive SQLite vulnerability) remains visible but does not cause build failures. This prevents unrelated build errors while awaiting an upstream dependency update.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant