Skip to content

Support stateful tests #28

@bendecoste

Description

@bendecoste

Hey!

I would like to add some custom tests that check something on an instance of my server. For example

s := &Server{
  database: MyDatabase
}

healthz.RegisterTest("db-alive", s.checkDb)

Where checkDb would implement TestFunc. However, since the registry is global, the above is problematic. Things like tests, where I will make several instances of my Server, will panic.

Would it be possible to use a non-global registry? Or support this use case some other way?

Thanks!

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