Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support stateful tests #28

Open
bendecoste opened this issue Mar 16, 2020 · 0 comments
Open

Support stateful tests #28

bendecoste opened this issue Mar 16, 2020 · 0 comments

Comments

@bendecoste
Copy link

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant