Skip to content

feat: migrate Domain.Tests to xUnit v3 (#163)#170

Merged
mpaulosky merged 2 commits into
sprint/7-xunit-v3-pilotfrom
squad/163-domain-tests-xunit-v3-migration
Apr 25, 2026
Merged

feat: migrate Domain.Tests to xUnit v3 (#163)#170
mpaulosky merged 2 commits into
sprint/7-xunit-v3-pilotfrom
squad/163-domain-tests-xunit-v3-migration

Conversation

@mpaulosky

Copy link
Copy Markdown
Owner

Summary

Migrates Domain.Tests from xUnit v2 (2.9.3) to xUnit v3 (3.2.2) as the pilot project for Sprint 7.

Working as Gimli (Tester) 🪓

Closes #163

Changes

File Change
Directory.Packages.props Added xunit.v3 3.2.2 alongside existing xunit 2.9.3 (other projects unaffected)
tests/Domain.Tests/Domain.Tests.csproj Replaced xunitxunit.v3 package reference; added xunit.runner.json as content
tests/Domain.Tests/xunit.runner.json New: v3 runner config (parallel execution, method display, no diagnostics)

Zero source changes required — the 42 test files use simple [Fact]/[Theory] patterns with no ITestOutputHelper, IAsyncLifetime, or collection fixtures. The Xunit namespace is unchanged in v3.

Test Results

Suite Result
Domain.Tests (xUnit v3) ✅ 42/42 pass
Architecture.Tests ✅ 11/11 pass
Web.Tests ✅ 105/105 pass
Web.Tests.Bunit ✅ 61/61 pass

Notes

- Add xunit.v3 3.2.2 to Directory.Packages.props
- Replace xunit → xunit.v3 package reference in Domain.Tests.csproj
- Add xunit.runner.json with v3-compatible runner configuration
- All 42 tests pass; no source file changes required (simple Facts/Theories)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings April 25, 2026 01:52
@github-actions github-actions Bot added the squad Squad triage inbox — Lead will assign to a member label Apr 25, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🏗️ PR Added to Squad Triage Queue

This PR has been labeled with squad and added to the triage queue.

Next steps:

  • The squad Lead will review and assign to an appropriate team member
  • A squad:member label will be added after triage

If you know which squad member should handle this, you can add the appropriate squad:member label yourself.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Migrates tests/Domain.Tests from xUnit v2 to xUnit v3 as a pilot for the broader multi-sprint rollout, while keeping the rest of the test projects on xUnit v2.

Changes:

  • Added xunit.v3 (3.2.2) to central package versions alongside existing xunit v2.
  • Switched tests/Domain.Tests to reference xunit.v3 and added an xUnit runner config file to output.
  • Introduced tests/Domain.Tests/xunit.runner.json with parallelization and method display settings.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
Directory.Packages.props Adds centrally-managed version for xunit.v3 to enable per-project migration.
tests/Domain.Tests/Domain.Tests.csproj Switches the test framework package to xunit.v3 and copies runner config to output.
tests/Domain.Tests/xunit.runner.json Adds xUnit runner configuration for Domain.Tests.

Comment on lines +19 to 20
<PackageReference Include="xunit.v3"/>
<PackageReference Include="xunit.runner.visualstudio"/>

Copilot AI Apr 25, 2026

Copy link

Choose a reason for hiding this comment

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

The migration to xUnit v3 in this project is missing the <OutputType>Exe</OutputType> change required by issue #163 (and recommended by the xUnit v3 migration guide for the new test host). Add OutputType=Exe in the main <PropertyGroup> for this project so the PR meets the acceptance criteria and avoids runner/adapter surprises.

Copilot uses AI. Check for mistakes.
</ItemGroup>

<ItemGroup>
<Content Include="xunit.runner.json" CopyToOutputDirectory="PreserveNewest"/>

Copilot AI Apr 25, 2026

Copy link

Choose a reason for hiding this comment

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

xunit.runner.json is already included by the SDK as a None item; adding it as Content Include=... can lead to the file being present in multiple item lists and makes this project inconsistent with the existing pattern in Web.Tests.Integration (which uses <None Update=...>). Prefer updating the existing None item (or removing the default inclusion) and set CopyToOutputDirectory there.

Suggested change
<Content Include="xunit.runner.json" CopyToOutputDirectory="PreserveNewest"/>
<None Update="xunit.runner.json" CopyToOutputDirectory="PreserveNewest"/>

Copilot uses AI. Check for mistakes.
@github-actions

Copy link
Copy Markdown
Contributor

Test Results Summary

209 tests  ±0   209 ✅ ±0   14s ⏱️ ±0s
  5 suites ±0     0 💤 ±0 
  5 files   ±0     0 ❌ ±0 

Results for commit 791c75d. ± Comparison against base commit e7035b1.

@codecov

codecov Bot commented Apr 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (sprint/7-xunit-v3-pilot@18e668f). Learn more about missing BASE report.

Additional details and impacted files
@@                    Coverage Diff                     @@
##             sprint/7-xunit-v3-pilot     #170   +/-   ##
==========================================================
  Coverage                           ?   72.53%           
==========================================================
  Files                              ?       43           
  Lines                              ?      721           
  Branches                           ?      112           
==========================================================
  Hits                               ?      523           
  Misses                             ?      149           
  Partials                           ?       49           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mpaulosky
mpaulosky merged commit 1b68ab1 into sprint/7-xunit-v3-pilot Apr 25, 2026
3 checks passed
@mpaulosky
mpaulosky deleted the squad/163-domain-tests-xunit-v3-migration branch April 25, 2026 02:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

squad Squad triage inbox — Lead will assign to a member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants