-
Notifications
You must be signed in to change notification settings - Fork 456
feat: upgrade xUnit to v3 #225
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: feature/upgrade_xunit_to_v3
Are you sure you want to change the base?
Conversation
…pendencies Co-authored-by: kamilbaczek <[email protected]>
…lyzer warnings Co-authored-by: kamilbaczek <[email protected]>
…pter 1 builds successfully Co-authored-by: kamilbaczek <[email protected]>
Co-authored-by: kamilbaczek <[email protected]>
kamilbaczek
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perform changes only in chapter 1 directories
|
@copilot Perform changes only in chapter 1 directories |
… changes Co-authored-by: kamilbaczek <[email protected]>
|
fix this |
|
fix this |
…nToken to all async test methods Co-authored-by: kamilbaczek <[email protected]>
|
|
…ility Co-authored-by: kamilbaczek <[email protected]>
... Fixed in commit 8d64fc5. Added Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
kamilbaczek
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR is ready!
📋 Description
Upgraded xUnit packages from v2 to v3 in Chapter 1 only, removing all v2 package references and addressing breaking API changes. Additionally, implemented proper CancellationToken usage following xUnit v3 best practices and added Verify.XunitV3 for snapshot testing compatibility.
Scope:
Chapter-1-initial-architecture/directory onlyPackage Updates (Chapter 1):
xunit→xunit.v3(3.2.0)xunit.runner.visualstudio→ 3.1.5xunit.analyzers→ 1.26.0xunit.categories(v2-only)Verify.XunitV3(31.7.3) for xUnit v3 compatible snapshot testingBreaking Changes Fixed:
IAsyncLifetimeimplementations:Task InitializeAsync()→ValueTask InitializeAsync()IAsyncLifetimeimplementations:Task DisposeAsync()→ValueTask DisposeAsync()DatabaseContainerimplementation in Chapter 1CancellationToken Implementation:
CancellationToken.NoneanddefaultwithTestContext.Current.CancellationTokenin all async test methodsGetAsync,PostAsJsonAsync,PatchAsJsonAsync) to pass cancellation tokenReadFromJsonAsynccalls to pass cancellation tokenVerify.XunitV3 Integration:
Verify.XunitV3package (31.7.3) which is the xUnit v3 compatible version of Verify.Xunitawait Verify(reportData)in GenerateNewPassesPerMonthReportTests for snapshot testing📦 PR Includes
🚫 PR Does Not Include
💡 Additional Notes
Suppressed xUnit1050 (untyped theory data) analyzer warning as informational in Chapter 1 test projects. Removed xUnit1051 (CancellationToken usage) suppression and properly implemented cancellation token passing instead. Chapter 1 builds successfully with xUnit v3 with 0 errors and 0 warnings. Chapters 2, 3, and 4 remain on their original xUnit v2 versions per feedback.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.