Skip to content

Make uniqueness guarantee for snapshots optional #415

Closed
@andrewlock

Description

@andrewlock
Contributor

Is the feature request related to a problem

In the Datadog APM tracer, we are using Verify with snapshots to verify a request is traced correctly. We run in two distinct modes, CallSite and CallTarget, and as such have separate tests for these. However, both tests should give the same output.

Verify enforces that each test uses a unique snapshot. That means we currently have duplicate snapshots for our tests, that could easily be consolidated, as half of them are identical.

Describe the solution

Providing a toggle to allow disabling of the uniqueness requirement for given test paths. I think this could be added as part of the UniqueFor API without too much friction?

Describe alternatives considered

Continuing to have many duplicate files (our existing solution), hard links between files (more hassle than it's worth)

Additional context

Thanks for the library! 🙇

Activity

SimonCropp

SimonCropp commented on Oct 13, 2021

@SimonCropp
Member

@andrewlock yep happy to add this. not sure if it should be at the UniqueFor level. since the use case could be when people are not even using the UniqueFor api. how about top level setting (static and instance?s

andrewlock

andrewlock commented on Oct 14, 2021

@andrewlock
ContributorAuthor

That's great, thanks @SimonCropp! Yes, that makes more sense I think.

I'm happy to work up a PR, or would you prefer to do it? Thanks again!

SimonCropp

SimonCropp commented on Oct 14, 2021

@SimonCropp
Member

sure. have a go at a pr. note i have moved to vs2022. if that is a complication i can handle the change

added this to the 13.2.0 milestone on Oct 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

      Development

      Participants

      @SimonCropp@andrewlock

      Issue actions

        Make uniqueness guarantee for snapshots optional · Issue #415 · VerifyTests/Verify