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

chore: use testify instead of t.Fatal #1677

Closed
wants to merge 1 commit into from

Conversation

mmorel-35
Copy link
Contributor

This uses testify instead of testing for t.Fatal calls

@mmorel-35 mmorel-35 force-pushed the golangci-lint/testifier branch 4 times, most recently from a4e06bf to 284fbc6 Compare November 8, 2024 08:33
@mmorel-35
Copy link
Contributor Author

/cc @SuperQ

@mmorel-35 mmorel-35 force-pushed the golangci-lint/testifier branch 3 times, most recently from d618c99 to 4ae174c Compare November 8, 2024 09:06
@mmorel-35 mmorel-35 marked this pull request as ready for review November 8, 2024 09:14
@mmorel-35 mmorel-35 force-pushed the golangci-lint/testifier branch 3 times, most recently from 61265ce to 16fdca0 Compare November 8, 2024 09:38
Copy link
Member

@bwplotka bwplotka left a 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
Copy link
Member

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.

@mmorel-35
Copy link
Contributor Author

Alright, let's close this one

@mmorel-35 mmorel-35 closed this Nov 8, 2024
@mmorel-35 mmorel-35 deleted the golangci-lint/testifier branch November 8, 2024 17:58
@beorn7
Copy link
Member

beorn7 commented Nov 12, 2024

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.

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

Successfully merging this pull request may close these issues.

3 participants