Skip to content

EF-475: Migrate unit and functional tests to xunit v3 (clean) - #384

Closed
ajcvickers wants to merge 7 commits into
mongodb:mainfrom
ajcvickers:EF-475-xunit3
Closed

ajcvickers wants to merge 7 commits into
mongodb:mainfrom
ajcvickers:EF-475-xunit3

Conversation

@ajcvickers

Copy link
Copy Markdown
Collaborator

Clean xunit v3 migration of the Unit and Functional test projects, based on #376 up to 3f14dc4. Excludes the later speculative CI changes (test DB prefix changes, dropped DisableTestParallelization, transaction retry, sequential run scripts) so Evergreen can be run against the plain migration.

damieng and others added 3 commits October 6, 2026 14:55
Move the xunit package reference out of tests/Directory.Build.props and into
each test project so projects can migrate independently. UnitTests now uses
xunit.v3; FunctionalTests and SpecificationTests stay on xunit 2.9.3 for now.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
- Reference xunit.v3 instead of xunit 2.9.3
- IAsyncLifetime fixtures now return ValueTask
- Custom Fact/Theory attributes set Skip in their constructor (Skip is no
  longer virtual) and pass through source information
- Drop the Xunit.Abstractions usings (ITestOutputHelper now lives in Xunit)
- Remove the Xunit.TestFramework assembly attribute; it named a type from an
  assembly that is not referenced anywhere
- Suppress xUnit1051 for now (CancellationToken analyzer)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ent test

SpecificationTests must stay on xunit v2 (the EF Core specification test
bases are built against it), but its project reference to FunctionalTests
pulled xunit.v3 in transitively and broke the build with ambiguous types.

- Remove the FunctionalTests project reference
- Copy the test-server utilities it needs (TestServer, TestContainersTestServer,
  ExternalDatabaseTestServer, TestDatabaseNamer, MongoCondition and the Atlas
  container builder) into SpecificationTests, using the xunit v2 signatures
- Make Shadow_property_can_be_used_for_rowversion bypass the model cache so it
  no longer depends on test order, which xunit v3 changed

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@evergreen-ci-prod

Copy link
Copy Markdown

There is an existing patch(es) for this commit SHA:

Please note that the status that is posted is not in the context of this PR but rather the (latest) existing patch and that may affect some tests that may depend on the particular PR. If your tests do not rely on any PR-specific values (like base or head branch name) then your tests will report the same status. If you would like a patch to run in the context of this PR and abort the other(s), comment 'evergreen retry'.

FunctionalTests and SpecificationTests run as concurrent processes under dotnet test on the solution and
generated identical database names (same prefix, 1s timestamp, counter from 1). Startup cleanup of the
shared prefix also dropped the other process's live databases.
dotnet test on the solution runs the test projects concurrently against one server, which makes MongoDB 5.0/6.0
fail intermittently with snapshot/catalog-change errors.
The server version segment pushed EF10 'latest' names such as
EF10-SpecTest-vlatest-<timestamp>NorthwindBulkUpdates-<n> to 64 characters, failing 181 spec tests.
Shorten the assembly part of the prefix and truncate the static name if the total would exceed 63.
@ajcvickers ajcvickers closed this Oct 21, 2026
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.

2 participants