Skip to content

Tests: Remove AutoFixture from the shipped Umbraco.Cms.Tests package#23141

Merged
AndyButland merged 1 commit into
mainfrom
v17/chore/decouple-autofixture
Jun 17, 2026
Merged

Tests: Remove AutoFixture from the shipped Umbraco.Cms.Tests package#23141
AndyButland merged 1 commit into
mainfrom
v17/chore/decouple-autofixture

Conversation

@ronaldbarendse

Copy link
Copy Markdown
Contributor

Description

Removes the AutoFixture.AutoMoq and AutoFixture.NUnit3 package references from Umbraco.Tests.Common and adds them to Umbraco.Tests.UnitTests instead.

Why

Umbraco.Tests.Common is packaged and shipped publicly as the Umbraco.Cms.Tests NuGet package (<PackageId>Umbraco.Cms.Tests</PackageId>), so every dependency it carries is forced onto downstream consumers who write tests against Umbraco.

AutoFixture.NUnit3 pins NUnit < 4. By having it in the shipped package, we transitively constrained all consumers of Umbraco.Cms.Tests to 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.UnitTests removes the constraint from the shipped package while keeping our own tests working.

Follow-up (future improvement)

The project name Umbraco.Tests.Common looks like an internal-only project, but it is actually the public, shipped Umbraco.Cms.Tests package — 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 match Umbraco.Cms.Tests) so it's obvious that anything added here ships to consumers.

Copilot AI review requested due to automatic review settings June 16, 2026 12:34
@claude

claude Bot commented Jun 16, 2026

Copy link
Copy Markdown

Claude finished @ronaldbarendse's task in 1m 52s —— View job


PR Review

Target: origin/main · Based on commit: 3a47f301 · Classified as: Config-only

Moves AutoFixture.AutoMoq and AutoFixture.NUnit3 package references from the publicly shipped Umbraco.Cms.Tests NuGet package (Umbraco.Tests.Common) into the internal-only Umbraco.Tests.UnitTests project, removing a transitive NUnit < 4 constraint that was forced onto all consumers of the package.


No issues found. I verified that Umbraco.Tests.Common contains no source files that reference AutoFixture types — the three occurrences of Fixture in UmbracoTestOptions.cs are unrelated enum value names (NewEmptyPerFixture, NewSchemaPerFixture, PerFixture). The move is safe.

Labels applied: area/test, category/test-automation


Approved

This looks good to be merged as-is, but please do a manual sanity check and testing before merging.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.AutoMoq and AutoFixture.NUnit3 from tests/Umbraco.Tests.Common (the packable Umbraco.Cms.Tests package).
  • Added AutoFixture.AutoMoq and AutoFixture.NUnit3 to tests/Umbraco.Tests.UnitTests where 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.

@sonarqubecloud

Copy link
Copy Markdown

@ronaldbarendse

Copy link
Copy Markdown
Contributor Author

@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.

@AndyButland AndyButland left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Makes sense, I'll cherry-pick this into release/18.0 so it'll be part of the 18.0.0-rc3.

@AndyButland AndyButland merged commit 190e3d3 into main Jun 17, 2026
34 checks passed
@AndyButland AndyButland deleted the v17/chore/decouple-autofixture branch June 17, 2026 07:47
AndyButland pushed a commit that referenced this pull request Jun 17, 2026
…23141)

Tests: Remove AutoFixture from Umbraco.Cms.Tests package
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants