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
relabel: move tests to separate package #14077
Conversation
…to BenchmarkProcess We should be naming the test functions based on the function they are testing. TestRelabel was testing the Process function, so it should be named TestProcess. Additionally, relabel is an unexported function so it should have its test function as Test_relabel instead. Signed-off-by: tesla59 <nishant@heim.id>
Signed-off-by: tesla59 <nishant@heim.id>
Relabel is the name of package so can be removed from the variable name. Signed-off-by: tesla59 <nishant@heim.id>
please review @machine424 |
The renaming seems to make sense. But what's the motivation for moving the tests into a separate package? I know the pattern exists, and some advocate it because it forces tests to only use exported parts of the package to test. But it also adds some friction, so I think there should be some motivation beyond "just follow the pattern". AFAIK we don't regularly use the pattern in the Prometheus codebase. Cases that come to mind have to do with avoiding circular package dependencies. @machine424 maybe you have discussed this with @tesla59 in advance? |
#13999 introduced the I mean, maybe we want that, but then it should be an informed decision taken by the team. For now, I would assume the current state is the desired one and not change it. |
Thank you for your initiatives and efforts, @tesla59. Also, you can always start discussions on Stack or here to test the waters before opening a PR. We can also have discussions on the PRs themselves though, as you like. ;) |
@machine424 made a good point about not renaming tests unless there is a very compelling reason. So let's close this PR. @tesla59, this is of course not meant to discourage you from further contributions. |
Move relabel package tests to a separate package relabel_test. Also rename the tests to clearly indicate what they are testing and benchmarking