Skip to content

Support unique test identifiers across hooks #125

Description

@shuryak

Is your feature request related to a problem? Please describe.
Within a single test (including all hooks like BeforeEach and AfterEach), I want to be able to consistently identify that all actions belong to the same test throughout its entire lifecycle. This will make it easier to manage and configure shared data in the Suite.

Describe the solution you'd like
One approach is to add a UniqueID() method to provider.T that returns the Suite method’s name. An even better option would be to return a hash of the method name, to avoid the temptation of relying directly on the method name itself through this UniqueID() method.

Describe alternatives you've considered
A possible workaround for now seems to be extracting the method name from t.RealT().Name(). The problem with this approach, however, is that the extraction can be unreliable since hooks modify the returned value.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions