-
-
Notifications
You must be signed in to change notification settings - Fork 390
Introduce common code for Recorders in Plugin Tests #3347
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
Conversation
hls-test-utils/src/Test/Hls.hs
Outdated
-- The created recorder writes to stderr if any of the given environment variables | ||
-- have been set to a value different to @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.
Why not write to stderr unconditionally, as the default recorder for HLS does?
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.
Lots of noise, makes it hard to tell what testcase failed, imo. However, thats also fine by me
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.
But this is already the status quo, and lsp-test
silences it anyway, so I'm not sure what the difference is
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.
No it is not, the status quo is, we hide the stderr unless LSP_TEST_LOG_STDERR=1
is given, take a look at this example run with the loggers for HLS and the testsuite writing to stderr vs not writing to stderr: https://paste.tomsmeding.com/0UbJEowE
Argh, I forgot we hadn't purged all of that yet >:( |
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!
I think "always have a recorder" is a good default tbh, so 👍 for refactoring things to make that the main way. |
aa69bda
to
24a81b2
Compare
d4d5ce1
to
fe57732
Compare
Ready for review, each commit modifies a single plugin so code owners can review exactly the commit they need to. For reviewers, the most important changes happen in hls-test-utils/src/Test/Hls.hs |
fe57732
to
108baf6
Compare
Every plugin should use the new functions. This way, we can guarantee predictable logging behaviour for tests. Most notably, we now have a single control point, for co-log style logging, how to write logs to stderr, and how to write logs for server and plugin at the same time.
108baf6
to
93d2587
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.
Thank you for great refactoring! LGTM 👍
93d2587
to
1c4c1d1
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.
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.
LGTM!
Plugin Tests need a recorder. Most plugin test-suite just set it to
mempty
, which, I think, will make it more difficult to debug test-failures.Some plugin test-suites roll their own plugin initialisation code. This is fine, but makes the logging behaviour non-uniform.
Introduce the
PluginTestDescriptor
type definition.Utility functions to create
PluginTestDescriptor
'smkPluginTestDescriptor
andmkPluginTestDescriptor'
which will help migrating plugins to the newer co-log style logger.