Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 28, 2025

This PR updates xUnit from v2.9.3 to v3.2.0-pre.10 and resolves all associated build errors and warnings.

Changes Made

  • xUnit Package: Updated from xunit v2.9.3 to xunit.v3 v3.2.0-pre.10
  • ValueTask Return Types: Updated all IAsyncLifetime implementations (23 test files) to return ValueTask instead of Task for InitializeAsync() and DisposeAsync() methods, as required by xUnit v3
  • Cancellation Token Support: Added TestContext.Current.CancellationToken to 120+ async method calls across 24 test files to enable responsive test cancellation
  • Using Statements: Added using Xunit.v3; where needed to access TestContext

Testing

  • ✅ Build succeeds with 0 errors and 0 warnings
  • ✅ Compatible with both .NET 8.0 and .NET 9.0 target frameworks
  • ✅ All xUnit v3 analyzer warnings resolved

Note: MongoDB is required to run the actual tests, but the code compiles successfully without it.

Fixes #4

Original prompt

This section details on the original issue you should resolve

<issue_title>Update xUnit to latest v3</issue_title>
<issue_description>Need to update xUnit to v3.

  • Fix all warnings about cancellation tokens
  • Fix all build errors looking for ValueTask rather than Task</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@JohnCampionJr
Copy link
Contributor

@copilot your environment will require mongodb installed to successfully run the tests

Copy link
Contributor Author

Copilot AI commented Oct 28, 2025

@copilot your environment will require mongodb installed to successfully run the tests

Understood. MongoDB is not available in this environment, so I'll update xUnit and fix any build errors/warnings, but won't be able to run the full test suite. I'll ensure the code compiles successfully.

Copilot AI and others added 2 commits October 28, 2025 01:40
Co-authored-by: JohnCampionJr <1094820+JohnCampionJr@users.noreply.github.com>
Co-authored-by: JohnCampionJr <1094820+JohnCampionJr@users.noreply.github.com>
Copilot AI changed the title [WIP] Update xUnit to latest v3 and resolve build issues Update xUnit to latest v3 and resolve build issues Oct 28, 2025
@JohnCampionJr JohnCampionJr marked this pull request as ready for review October 28, 2025 01:55
@JohnCampionJr JohnCampionJr merged commit ed0c34e into main Oct 28, 2025
1 check failed
@JohnCampionJr JohnCampionJr deleted the copilot/update-xunit-to-v3 branch October 28, 2025 01:55
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.

Update xUnit to latest v3

2 participants