Move Microsoft.Extensions.VectorData.ConformanceTests to xUnit 3 - #7636
Conversation
There was a problem hiding this comment.
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
IAsyncLifetimeimplementations/overrides to useValueTask InitializeAsync()/ValueTask DisposeAsync()(andasync ValueTaskwhere 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
left a comment
There was a problem hiding this comment.
@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)
Fixed in commit — added |
|
/backport to release/10.8 |
|
Started backporting to release/10.8: https://github.com/dotnet/extensions/actions/runs/29994183747 |
Microsoft.Extensions.VectorData.ConformanceTestswas still publishingxunit2.9.3 even after the broader xUnit 3 migration. The package lives undersrc/and had its own explicit xUnit 2 reference, so its NuGet dependency graph never picked up the test-project migration.Package dependencies
xunitmeta-package reference with explicit xUnit 3 dependencies:xunit.v3.assertxunit.v3.extensibility.core$(XUnitV3Version)so the packed package resolves to xUnit 3.xUnit 3 compatibility
IAsyncLifetimeto use xUnit 3’sValueTask-basedInitializeAsyncandDisposeAsyncsignatures.Resulting package surface
Microsoft.Extensions.VectorData.ConformanceTestspackage now carries xUnit 3 dependencies instead ofxunit2.9.3.Microsoft Reviewers: Open in CodeFlow