Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign uppromql needlessly imports "testing" which adds a bunch of needless flags #3915
Comments
This was referenced Mar 6, 2018
This comment has been minimized.
This comment has been minimized.
|
This came up in the past. Remvoing the dependency was tricky for various reasons. |
This comment has been minimized.
This comment has been minimized.
|
so, if the testing flags are not desired, apps should not define any global flags then? |
This comment has been minimized.
This comment has been minimized.
Yes. That's generally better in every way. |
brian-brazil
added
kind/cleanup
priority/Pmaybe
component/promql
labels
Mar 20, 2018
This comment has been minimized.
This comment has been minimized.
|
Do you have a proposal for disentangling this? |
This comment has been minimized.
This comment has been minimized.
|
me? no. realistically i won't have time to work on this. (if no one has, feel free to close this) |
This comment has been minimized.
This comment has been minimized.
|
We can put it down as something to consider as we develop a promql testing tool for users, but beyond that I don't think anyone is prioritising this. |
brian-brazil
closed this
Mar 20, 2018
krasi-georgiev
referenced this issue
Jul 18, 2018
Merged
Don't import testing in code which is imported from non-test code. #4400
This comment has been minimized.
This comment has been minimized.
lock
bot
commented
Mar 22, 2019
|
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Dieterbe commentedMar 6, 2018
•
edited
github.com/prometheus/prometheus/promql imports github.com/prometheus/prometheus/util/testutil which imports "testing".
the result is that any tool (3rd party) which imports github.com/prometheus/prometheus/promql imports testing, which if said tool uses flags, then a bunch of flags are added automatically by the testing package:
these flags are irrelevant and thus confusing. they pollute help/usage messages for tools that don't invoke any testing logic.
as far as I know, only test code should actually import "testing"; not regular application code or libraries.