-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
github.com/sirupsen/logrus
usage refactoring
#2960
Conversation
Hey, @na--, I'll start working on grafana/xk6-browser#818. In the first step, I switched to this branch, ran the tests at the root with the following command, and some failed. Are these known to be flaky?
|
It seems it was flaky and was disabled on Windows before (#902), but it's currently not disabled 😕 In any case, I added a note about it in #2144 (comment) |
@na-- LGTM, I've mostly requested the change for the browser |
Codecov Report
@@ Coverage Diff @@
## update-xk6-browser #2960 +/- ##
=====================================================
Coverage ? 76.91%
=====================================================
Files ? 228
Lines ? 17043
Branches ? 0
=====================================================
Hits ? 13108
Misses ? 3089
Partials ? 846
Flags with carried forward coverage won't be shown. Click here to find out more. Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
This should now be ready for another review. I rebased on top of #2994, with some extra improvements. There is one part of the codebase that I haven't refactored and instead used a type assertion hack to work around. It would require a much larger refactoring, since it has a bunch of problems with it. I opened #2968 specifically for that, so we can fix it in another PR |
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.
LGTM
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.
Nice 👍
We'll still need some tedious work to switch to slog, as the interfaces don't quite match up, but this is a step in the right direction.
This is in preparation for removing that dependency at some future point
This commit fixes an incompatibility detected with k6 core usage of state.Logger, which has been modified in grafana/k6#2960.
This commit fixes an incompatibility detected with k6 core usage of state.Logger, which has been modified in grafana/k6#2960.
This commit fixes an incompatibility detected with k6 core usage of state.Logger, which has been modified in grafana/k6#2960.
This commit fixes an incompatibility detected with k6 core usage of state.Logger, which has been modified in grafana/k6#2960. Co-authored-by: İnanç Gümüş <inanc.gumus@grafana.com>
For some reason, my very sleep-deprived brain got stuck on these logging minutia today 🤦♂️ Still, the zombie state somewhat good at slogging through repetitive code modifications, so at least something semi-useful might come out of it in the long run... 😅 🤞
This is one small part of #2958. Because of grafana/xk6-browser#818, this PR requires #2994 to be merged first.
The important parts here are replacement of the
*logrus.Logger
concrete type usage withlogrus.FieldLogger
interface in a bunch of places, most importantly in the the VUlib.State
and thelib.TestPreInitState
🎉 Thetestutils
refactoring from manually constructed objects to constructor functions + removing any usage ofgithub.com/sirupsen/logrus/hooks/test
is both making it easier to write tests now, and hopefully also making it easier to remove logrus in the future.