Tests: Remove AutoFixture from the shipped Umbraco.Cms.Tests package#23141
Conversation
|
Claude finished @ronaldbarendse's task in 1m 52s —— View job PR ReviewTarget: Moves No issues found. I verified that Labels applied: ApprovedThis looks good to be merged as-is, but please do a manual sanity check and testing before merging. |
There was a problem hiding this comment.
Pull request overview
This PR adjusts test-project dependencies so that AutoFixture packages are no longer included in the publicly shipped Umbraco.Cms.Tests NuGet package (project Umbraco.Tests.Common), preventing unnecessary transitive constraints on downstream test projects.
Changes:
- Removed
AutoFixture.AutoMoqandAutoFixture.NUnit3fromtests/Umbraco.Tests.Common(the packableUmbraco.Cms.Testspackage). - Added
AutoFixture.AutoMoqandAutoFixture.NUnit3totests/Umbraco.Tests.UnitTestswhere they are actually used.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| tests/Umbraco.Tests.UnitTests/Umbraco.Tests.UnitTests.csproj | Adds AutoFixture package references to the internal unit test project. |
| tests/Umbraco.Tests.Common/Umbraco.Tests.Common.csproj | Removes AutoFixture package references from the shipped Umbraco.Cms.Tests package. |
|
|
@AndyButland Since this PR is very small and easy to review - it would be great if it could be included in the 17.5.0 and 18.0.0 releases 🥺 This would unblock upgrading our DXP product test suites to NUnit 4, enabling proper async/await assertions, cooperative cancellation support, nullability improvements and more. |
…23141) Tests: Remove AutoFixture from Umbraco.Cms.Tests package



Description
Removes the
AutoFixture.AutoMoqandAutoFixture.NUnit3package references fromUmbraco.Tests.Commonand adds them toUmbraco.Tests.UnitTestsinstead.Why
Umbraco.Tests.Commonis packaged and shipped publicly as theUmbraco.Cms.TestsNuGet package (<PackageId>Umbraco.Cms.Tests</PackageId>), so every dependency it carries is forced onto downstream consumers who write tests against Umbraco.AutoFixture.NUnit3pinsNUnit < 4. By having it in the shipped package, we transitively constrained all consumers ofUmbraco.Cms.Teststo NUnit 3.x, blocking them (and us) from moving to NUnit 4.AutoFixture is only actually used by our internal unit tests, not by the public test-tooling surface (builders, etc.) that the package is meant to provide. Moving the references to
Umbraco.Tests.UnitTestsremoves the constraint from the shipped package while keeping our own tests working.Follow-up (future improvement)
The project name
Umbraco.Tests.Commonlooks like an internal-only project, but it is actually the public, shippedUmbraco.Cms.Testspackage — which is exactly what made this dependency leak easy to miss. We should align the project name with the package ID (e.g. rename the project to matchUmbraco.Cms.Tests) so it's obvious that anything added here ships to consumers.