Remove Snapshooter and ChilliCream.Testing.Utilities#9794
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR removes the remaining usages of Snapshooter.Xunit and ChilliCream.Testing.Utilities from StrawberryShake CodeGeneration tests by standardizing on CookieCrumble (already used broadly in the repo), and updates test infrastructure accordingly.
Changes:
- Replaces Snapshooter/ChilliCream testing utilities with CookieCrumble across CodeGeneration test projects (global usings + references, updated imports).
- Reworks
GeneratorTestHelperintegration snapshot path logic to rely on[CallerFilePath]and a custom “match snapshot at path” helper. - Removes
Snapshooter.Xunit/ChilliCream.Testing.Utilitiespackage versions from central package management and cleans up a snapshot file encoding artifact (BOM).
Reviewed changes
Copilot reviewed 26 out of 26 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/StrawberryShake/CodeGeneration/test/Directory.Build.props | Switches test dependencies to CookieCrumble project refs and adds a compile exclude for __mismatch__ artifacts. |
| src/StrawberryShake/CodeGeneration/test/CodeGeneration.Tests/Utilities/SchemaHelperTests.cs | Removes ChilliCream.Testing import. |
| src/StrawberryShake/CodeGeneration/test/CodeGeneration.Tests/Utilities/QueryDocumentRewriterTests.cs | Removes Snapshooter.Xunit import. |
| src/StrawberryShake/CodeGeneration/test/CodeGeneration.Tests/Utilities/OperationDocumentHelperTests.cs | Switches FileResource static import from ChilliCream to CookieCrumble. |
| src/StrawberryShake/CodeGeneration/test/CodeGeneration.Tests/Mappers/TestDataHelper.cs | Switches FileResource static import from ChilliCream to CookieCrumble. |
| src/StrawberryShake/CodeGeneration/test/CodeGeneration.Razor.Tests/GeneratorTestHelper.cs | Removes Snapshooter usage and adds a custom path-based snapshot matcher using [CallerFilePath]. |
| src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/StarWarsGeneratorTests.cs | Removes ChilliCream.Testing import. |
| src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/SchemaGeneratorTests.cs | Removes ChilliCream.Testing import. |
| src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/ScalarGeneratorTests.cs | Removes ChilliCream.Testing import. |
| src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/OperationGeneratorTests.cs | Removes ChilliCream.Testing import. |
| src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/NoStoreStarWarsGeneratorTests.cs | Removes ChilliCream.Testing import. |
| src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/Integration/TestGeneration.cs | Removes ChilliCream.Testing import. |
| src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/Integration/StarWarsUnionListTest.cs | Removes Snapshooter.Xunit import. |
| src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/Integration/StarWarsTypeNameOnUnionsTest.cs | Removes Snapshooter.Xunit import. |
| src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/Integration/StarWarsTypeNameOnInterfacesTest.cs | Removes Snapshooter.Xunit import. |
| src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/Integration/StarWarsIntrospectionTest.cs | Removes Snapshooter.Xunit import. |
| src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/Integration/EntityIdOrDataTest.cs | Removes Snapshooter.Xunit import. |
| src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/Integration/AnyScalarDefaultSerializationTest.cs | Removes Snapshooter.Xunit import. |
| src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/Integration/snapshots/StarWarsIntrospectionTest.Execute_StarWarsIntrospection_Test.snap | Removes BOM/normalizes snapshot file start/end formatting. |
| src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/InputGeneratorTests.cs | Removes ChilliCream.Testing import. |
| src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/GeneratorTestHelper.cs | Removes Snapshooter usage and adds a custom path-based snapshot matcher using [CallerFilePath]. |
| src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/ErrorGeneratorTests.cs | Removes ChilliCream.Testing import. |
| src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests/EntityGeneratorTests.cs | Removes ChilliCream.Testing import. |
| src/StrawberryShake/Client/test/Core.Tests/Integration/Mappers/DroidHeroMapper.cs | Switches from ChilliCream.Testing to CookieCrumble import (currently unused). |
| src/StrawberryShake/Client/test/Core.Tests/Integration/IntegrationTests.cs | Switches from ChilliCream.Testing to CookieCrumble import (for FileResource). |
| src/Directory.Packages.props | Removes central package versions for Snapshooter.Xunit and ChilliCream.Testing.Utilities. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This was referenced Jun 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Snapshooter.XunitandChilliCream.Testing.Utilitiesusers from the repo (StrawberryShake CodeGeneration tests) in favor ofCookieCrumble, which already powers ~99% of the snapshot suite.GeneratorTestHelperto use[CallerFilePath]and a small inline file-snapshot helper, replacing the Snapshooter-specificSnapshotFullName+ custom-pathMatchSnapshotmechanic that has no direct CookieCrumble equivalent.PackageVersionentries fromDirectory.Packages.propsand the correspondingPackageReferences fromCodeGeneration/test/Directory.Build.props; wires upCookieCrumble.Xunit+CookieCrumble.AnalyzersviaProjectReferencematching the convention used byHotChocolate/Core/testandStrawberryShake/Client/test.Test plan
dotnet build src/StrawberryShake/CodeGeneration/StrawberryShake.CodeGeneration.slnxdotnet test src/StrawberryShake/CodeGeneration/test/CodeGeneration.Tests— 29 passed, 1 skippeddotnet test src/StrawberryShake/CodeGeneration/test/CodeGeneration.CSharp.Tests— 188 passed, 1 skippeddotnet test src/StrawberryShake/CodeGeneration/test/CodeGeneration.Razor.Tests— 1 passed