-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
chore: use testify instead of t.Fatal #1677
Conversation
a4e06bf
to
284fbc6
Compare
/cc @SuperQ |
d618c99
to
4ae174c
Compare
61265ce
to
16fdca0
Compare
Signed-off-by: Matthieu MOREL <[email protected]>
16fdca0
to
3b03264
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this, but the last maintainer's decision is to not include extra dependencies which are not mandatory for the project. While a bit verbose, we kept client_golang without testify for long and it would be nice to keep that.
@@ -12,21 +12,25 @@ require ( | |||
github.com/prometheus/client_model v0.6.1 | |||
github.com/prometheus/common v0.60.1 | |||
github.com/prometheus/procfs v0.15.1 | |||
github.com/stretchr/testify v1.9.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't want to add extra dependency on purpose in client_golang for little value.
Alright, let's close this one |
In this case, it's not so much about the added dependency, but about the controversial nature of testing frameworks within the Go community. There is a school of Go that recommends to only use the standard library tools for testing. prometheus/client_golang is so widely used that we would rather stick to the common ground here. Personally, I think a testing framework is fine within a certain group of developers that have found a consensus to use it. That's the reason why testify is used in prometheus/prometheus. However, prometheus/client_golang is used by ~everyone, which is again a reason to keep the code as "normal" as possible so everyone can read it without learning a special framework first. |
This uses testify instead of testing for t.Fatal calls