-
Notifications
You must be signed in to change notification settings - Fork 109
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
feature: emit GHC events on test start and completion #413
Conversation
I know absolutely nothing about event log profiling. @TeofilC could you possibly advise? @edmundnoble could you please point me to a branch with an "indirect" approach to compare? |
This branch allows producing time profiles of test suites without using GHC events. It requires some extra parts to actually use; I used this patch to tasty-json. |
This sounds like a great idea to me! I would suggest making it configurable whether to emit these events to the eventlog.
I wonder as well if this could be implemented as an extension to You might also be interested in (if you haven't seen it already) https://github.com/ethercrow/opentelemetry-haskell. This library uses a different eventlog convention, but lets you export to more types of formats (eg, chrome traces, tracy, or opentelemtry) |
Oh, I had figured the eventlog convention was agreed on. To me that seems like the biggest issue preventing this from being truly standard. I'm not sure where exactly to implement this if it's going to live outside of the runner proper. Perhaps as an Ingredient? @Bodigrim EDIT: I might even put this in the opentelemetry-haskell repo. |
Could it be implemented as a newtype wrapper with a custom |
The biggest downside is that
This is close in spirit to what, say, |
Not having test names seems to be a non-starter. There's another issue with this PR too; in the spirit of distributed tracing, one would usually like a "span" for not just individual test cases, but also whole test groups. I don't think we can do that with Perhaps it makes more sense to be content with the other branch. Would you take a PR with it? Or am I breaking too much stuff by adding a field to |
They are exposed: https://hackage.haskell.org/package/tasty-1.5/docs/Test-Tasty-Runners.html#t:TestTree
I'm not a fan of ad-hoc extending |
Ok I will probably just write a function over |
This PR makes tasty emit events to the event log in the style expected by https://github.com/well-typed/ghc-events-analyze for the purpose of building a time profile of a test suite. I also have a patch which does this more indirectly by shoving the start time of a test into a
Result
, if that's preferable. One thing that's nice about events is that if the code under test also emits events, that makes for a very interesting time profile.