Skip to content

Approval test infrastructure for Particular repositories

License

Notifications You must be signed in to change notification settings

Particular/Particular.Approvals

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

0b275db · Dec 13, 2024
Dec 13, 2024
Dec 9, 2024
Oct 31, 2024
Jan 11, 2023
Jun 1, 2023
Apr 8, 2020
Dec 20, 2019
Aug 1, 2023
Aug 1, 2023
Dec 9, 2024
Nov 9, 2023

Repository files navigation

Particular.Approvals

This repo contains our standardized way of using approval tests to verify and highlight any changes to public APIs.

Deployment

Tagged versions are automatically pushed to feedz.io. After validating new versions, the package should be promoted to production by pushing the package to NuGet using the feedz.io push upstream feature.

Migration to Particular.Approvals

  1. Remove ApprovalTests, ApprovalUtilities, and ObjectApproval packages
  2. Add Particular.Approvals package
  3. Update PublicApiGenerator to latest version
  4. Remove <Optimize>False</Optimize> from test project file
  5. Remove any [MethodImpl(MethodImplOptions.NoInlining)] from tests using approvals
  6. Update tests to use Approver.Verify()
  7. Move all approval files into an ApprovalFiles folder in the root of the test project
  8. Remove ApprovalTestConfig.cs, TestApprover.cs, etc (anything directly referencing ApprovalTests)

After conversion, an API approval test should look identical to the following (other than adjusting the specific type, of course): https://github.com/Particular/NServiceBus.AzureStorageQueues/blob/master/src/Tests/APIApprovals.cs

If a project isn't multi-targeted you could skip the excludeAttributes, but it wouldn't hurt to have it regardless.