Skip to content

Move Microsoft.Extensions.VectorData.ConformanceTests to xUnit 3 - #7636

Merged
adamsitnik merged 3 commits into
mainfrom
copilot/update-vectordata-conformance-tests
Jul 17, 2026
Merged

Move Microsoft.Extensions.VectorData.ConformanceTests to xUnit 3#7636
adamsitnik merged 3 commits into
mainfrom
copilot/update-vectordata-conformance-tests

Conversation

Copilot AI commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Microsoft.Extensions.VectorData.ConformanceTests was still publishing xunit 2.9.3 even after the broader xUnit 3 migration. The package lives under src/ and had its own explicit xUnit 2 reference, so its NuGet dependency graph never picked up the test-project migration.

  • Package dependencies

    • Replace the xunit meta-package reference with explicit xUnit 3 dependencies:
      • xunit.v3.assert
      • xunit.v3.extensibility.core
    • Switch the version source from the old xUnit 2 override to $(XUnitV3Version) so the packed package resolves to xUnit 3.
  • xUnit 3 compatibility

    • Update conformance test types implementing IAsyncLifetime to use xUnit 3’s ValueTask-based InitializeAsync and DisposeAsync signatures.
    • Keep the existing fixture initialization and reseeding flow intact while aligning with the xUnit 3 interfaces.
  • Resulting package surface

    • The packed Microsoft.Extensions.VectorData.ConformanceTests package now carries xUnit 3 dependencies instead of xunit 2.9.3.
<ItemGroup>
  <PackageReference Include="xunit.v3.assert" VersionOverride="$(XUnitV3Version)" />
  <PackageReference Include="xunit.v3.extensibility.core" VersionOverride="$(XUnitV3Version)" />
</ItemGroup>
Microsoft Reviewers: Open in CodeFlow

@adamsitnik
adamsitnik marked this pull request as ready for review July 16, 2026 18:15
Copilot AI review requested due to automatic review settings July 16, 2026 18:15

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 Microsoft.Extensions.VectorData.ConformanceTests shipping package to align with the repository’s xUnit 3 migration by switching its NuGet dependencies from xUnit 2 to xUnit 3 and updating IAsyncLifetime implementations to use the xUnit 3 ValueTask-based async lifecycle signatures.

Changes:

  • Replaced the xunit (v2) meta-package dependency with explicit xUnit 3 dependencies and versioning via $(XUnitV3Version).
  • Updated all IAsyncLifetime implementations/overrides to use ValueTask InitializeAsync() / ValueTask DisposeAsync() (and async ValueTask where appropriate).

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/Libraries/Microsoft.Extensions.VectorData.ConformanceTests/Microsoft.Extensions.VectorData.ConformanceTests.csproj Switch package dependencies from xUnit 2 meta-package to explicit xUnit 3 packages using $(XUnitV3Version).
src/Libraries/Microsoft.Extensions.VectorData.ConformanceTests/Support/VectorStoreFixture.cs Update IAsyncLifetime lifecycle methods to return ValueTask and wrap existing Task-based startup/shutdown calls.
src/Libraries/Microsoft.Extensions.VectorData.ConformanceTests/Support/VectorStoreCollectionFixtureBase.cs Update overridden fixture initialization to async ValueTask while keeping existing setup/seed flow intact.
src/Libraries/Microsoft.Extensions.VectorData.ConformanceTests/TypeTests/DataTypeTests.cs Update fixture initialization override signature to async ValueTask.
src/Libraries/Microsoft.Extensions.VectorData.ConformanceTests/FilterTests.cs Update fixture initialization override signature to async ValueTask.
src/Libraries/Microsoft.Extensions.VectorData.ConformanceTests/CollectionManagementTests.cs Update IAsyncLifetime implementation to ValueTask signatures for per-test collection cleanup.
src/Libraries/Microsoft.Extensions.VectorData.ConformanceTests/ModelTests/BasicModelTests.cs Update IAsyncLifetime implementation to ValueTask signatures (reseeding + no-op dispose).
src/Libraries/Microsoft.Extensions.VectorData.ConformanceTests/ModelTests/DynamicModelTests.cs Update IAsyncLifetime implementation to ValueTask signatures (reseeding + no-op dispose).
src/Libraries/Microsoft.Extensions.VectorData.ConformanceTests/ModelTests/MultiVectorModelTests.cs Update IAsyncLifetime implementation to ValueTask signatures (reseeding + no-op dispose).
src/Libraries/Microsoft.Extensions.VectorData.ConformanceTests/ModelTests/NoDataModelTests.cs Update IAsyncLifetime implementation to ValueTask signatures (reseeding + no-op dispose).
src/Libraries/Microsoft.Extensions.VectorData.ConformanceTests/ModelTests/NoVectorModelTests.cs Update IAsyncLifetime implementation to ValueTask signatures (reseeding + no-op dispose).

@adamsitnik adamsitnik left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@copilot fix following build failures:

/mnt/vss/_work/1/s/src/Libraries/Microsoft.Extensions.VectorData.ConformanceTests/CollectionManagementTests.cs(114,22): error CA1816: Change CollectionManagementTests<TKey>.DisposeAsync() to call GC.SuppressFinalize(object). This will prevent derived types that introduce a finalizer from needing to re-implement 'IDisposable' to call it. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1816) [/mnt/vss/_work/1/s/src/Libraries/Microsoft.Extensions.VectorData.ConformanceTests/Microsoft.Extensions.VectorData.ConformanceTests.csproj::TargetFramework=net10.0]
/mnt/vss/_work/1/s/src/Libraries/Microsoft.Extensions.VectorData.ConformanceTests/Support/VectorStoreFixture.cs(22,30): error CA1816: Change VectorStoreFixture.DisposeAsync() to call GC.SuppressFinalize(object). This will prevent derived types that introduce a finalizer from needing to re-implement 'IDisposable' to call it. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1816) [/mnt/vss/_work/1/s/src/Libraries/Microsoft.Extensions.VectorData.ConformanceTests/Microsoft.Extensions.VectorData.ConformanceTests.csproj::TargetFramework=net10.0]
/mnt/vss/_work/1/s/src/Libraries/Microsoft.Extensions.VectorData.ConformanceTests/ModelTests/NoVectorModelTests.cs(118,22): error CA1816: Change NoVectorModelTests<TKey>.DisposeAsync() to call GC.SuppressFinalize(object). This will prevent derived types that introduce a finalizer from needing to re-implement 'IDisposable' to call it. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1816) [/mnt/vss/_work/1/s/src/Libraries/Microsoft.Extensions.VectorData.ConformanceTests/Microsoft.Extensions.VectorData.ConformanceTests.csproj::TargetFramework=net10.0]
/mnt/vss/_work/1/s/src/Libraries/Microsoft.Extensions.VectorData.ConformanceTests/ModelTests/BasicModelTests.cs(552,22): error CA1816: Change BasicModelTests<TKey>.DisposeAsync() to call GC.SuppressFinalize(object). This will prevent derived types that introduce a finalizer from needing to re-implement 'IDisposable' to call it. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1816) [/mnt/vss/_work/1/s/src/Libraries/Microsoft.Extensions.VectorData.ConformanceTests/Microsoft.Extensions.VectorData.ConformanceTests.csproj::TargetFramework=net10.0]
/mnt/vss/_work/1/s/src/Libraries/Microsoft.Extensions.VectorData.ConformanceTests/ModelTests/NoDataModelTests.cs(112,22): error CA1816: Change NoDataModelTests<TKey>.DisposeAsync() to call GC.SuppressFinalize(object). This will prevent derived types that introduce a finalizer from needing to re-implement 'IDisposable' to call it. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1816) [/mnt/vss/_work/1/s/src/Libraries/Microsoft.Extensions.VectorData.ConformanceTests/Microsoft.Extensions.VectorData.ConformanceTests.csproj::TargetFramework=net10.0]
/mnt/vss/_work/1/s/src/Libraries/Microsoft.Extensions.VectorData.ConformanceTests/ModelTests/MultiVectorModelTests.cs(159,22): error CA1816: Change MultiVectorModelTests<TKey>.DisposeAsync() to call GC.SuppressFinalize(object). This will prevent derived types that introduce a finalizer from needing to re-implement 'IDisposable' to call it. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1816) [/mnt/vss/_work/1/s/src/Libraries/Microsoft.Extensions.VectorData.ConformanceTests/Microsoft.Extensions.VectorData.ConformanceTests.csproj::TargetFramework=net10.0]
/mnt/vss/_work/1/s/src/Libraries/Microsoft.Extensions.VectorData.ConformanceTests/ModelTests/DynamicModelTests.cs(442,22): error CA1816: Change DynamicModelTests<TKey>.DisposeAsync() to call GC.SuppressFinalize(object). This will prevent derived types that introduce a finalizer from needing to re-implement 'IDisposable' to call it. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1816) [/mnt/vss/_work/1/s/src/Libraries/Microsoft.Extensions.VectorData.ConformanceTests/Microsoft.Extensions.VectorData.ConformanceTests.csproj::TargetFramework=net10.0]
/mnt/vss/_work/1/s/src/Libraries/Microsoft.Extensions.VectorData.ConformanceTests/Support/VectorStoreFixture.cs(22,30): error CA1816: Change VectorStoreFixture.DisposeAsync() to call GC.SuppressFinalize(object). This will prevent derived types that introduce a finalizer from needing to re-implement 'IDisposable' to call it. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1816) [/mnt/vss/_work/1/s/src/Libraries/Microsoft.Extensions.VectorData.ConformanceTests/Microsoft.Extensions.VectorData.ConformanceTests.csproj::TargetFramework=net472]
/mnt/vss/_work/1/s/src/Libraries/Microsoft.Extensions.VectorData.ConformanceTests/ModelTests/NoVectorModelTests.cs(118,22): error CA1816: Change NoVectorModelTests<TKey>.DisposeAsync() to call GC.SuppressFinalize(object). This will prevent derived types that introduce a finalizer from needing to re-implement 'IDisposable' to call it. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1816) [/mnt/vss/_work/1/s/src/Libraries/Microsoft.Extensions.VectorData.ConformanceTests/Microsoft.Extensions.VectorData.ConformanceTests.csproj::TargetFramework=net472]
/mnt/vss/_work/1/s/src/Libraries/Microsoft.Extensions.VectorData.ConformanceTests/CollectionManagementTests.cs(114,22): error CA1816: Change CollectionManagementTests<TKey>.DisposeAsync() to call GC.SuppressFinalize(object). This will prevent derived types that introduce a finalizer from needing to re-implement 'IDisposable' to call it. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1816) [/mnt/vss/_work/1/s/src/Libraries/Microsoft.Extensions.VectorData.ConformanceTests/Microsoft.Extensions.VectorData.ConformanceTests.csproj::TargetFramework=net472]
/mnt/vss/_work/1/s/src/Libraries/Microsoft.Extensions.VectorData.ConformanceTests/ModelTests/NoDataModelTests.cs(112,22): error CA1816: Change NoDataModelTests<TKey>.DisposeAsync() to call GC.SuppressFinalize(object). This will prevent derived types that introduce a finalizer from needing to re-implement 'IDisposable' to call it. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1816) [/mnt/vss/_work/1/s/src/Libraries/Microsoft.Extensions.VectorData.ConformanceTests/Microsoft.Extensions.VectorData.ConformanceTests.csproj::TargetFramework=net472]
/mnt/vss/_work/1/s/src/Libraries/Microsoft.Extensions.VectorData.ConformanceTests/ModelTests/MultiVectorModelTests.cs(159,22): error CA1816: Change MultiVectorModelTests<TKey>.DisposeAsync() to call GC.SuppressFinalize(object). This will prevent derived types that introduce a finalizer from needing to re-implement 'IDisposable' to call it. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1816) [/mnt/vss/_work/1/s/src/Libraries/Microsoft.Extensions.VectorData.ConformanceTests/Microsoft.Extensions.VectorData.ConformanceTests.csproj::TargetFramework=net472]
/mnt/vss/_work/1/s/src/Libraries/Microsoft.Extensions.VectorData.ConformanceTests/ModelTests/DynamicModelTests.cs(442,22): error CA1816: Change DynamicModelTests<TKey>.DisposeAsync() to call GC.SuppressFinalize(object). This will prevent derived types that introduce a finalizer from needing to re-implement 'IDisposable' to call it. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1816) [/mnt/vss/_work/1/s/src/Libraries/Microsoft.Extensions.VectorData.ConformanceTests/Microsoft.Extensions.VectorData.ConformanceTests.csproj::TargetFramework=net472]
/mnt/vss/_work/1/s/src/Libraries/Microsoft.Extensions.VectorData.ConformanceTests/ModelTests/BasicModelTests.cs(552,22): error CA1816: Change BasicModelTests<TKey>.DisposeAsync() to call GC.SuppressFinalize(object). This will prevent derived types that introduce a finalizer from needing to re-implement 'IDisposable' to call it. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1816) [/mnt/vss/_work/1/s/src/Libraries/Microsoft.Extensions.VectorData.ConformanceTests/Microsoft.Extensions.VectorData.ConformanceTests.csproj::TargetFramework=net472]
    0 Warning(s)
    14 Error(s)

@dotnet-policy-service dotnet-policy-service Bot added the waiting-author-feedback 📭 The author of this issue needs to respond in order for us to continue investigating this issue. label Jul 17, 2026

Copilot AI commented Jul 17, 2026

Copy link
Copy Markdown
Contributor Author

@copilot fix following build failures:

Fixed in commit — added GC.SuppressFinalize(this) to all 7 DisposeAsync() methods across VectorStoreFixture.cs, CollectionManagementTests.cs, and the five model test files.

Copilot AI requested a review from adamsitnik July 17, 2026 09:03
@dotnet-policy-service dotnet-policy-service Bot removed the waiting-author-feedback 📭 The author of this issue needs to respond in order for us to continue investigating this issue. label Jul 17, 2026
@adamsitnik
adamsitnik requested a review from roji July 17, 2026 09:49
@adamsitnik
adamsitnik enabled auto-merge (squash) July 17, 2026 10:14
@adamsitnik
adamsitnik merged commit 27ad9d6 into main Jul 17, 2026
5 checks passed
@adamsitnik
adamsitnik deleted the copilot/update-vectordata-conformance-tests branch July 17, 2026 10:45
@jeffhandley

Copy link
Copy Markdown
Member

/backport to release/10.8

@github-actions

Copy link
Copy Markdown
Contributor

Started backporting to release/10.8: https://github.com/dotnet/extensions/actions/runs/29994183747

@github-actions github-actions Bot locked and limited conversation to collaborators Aug 23, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants