Skip to content
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

Provide Test Helpers Publicly #242

Open
Mordil opened this issue Dec 22, 2022 · 7 comments
Open

Provide Test Helpers Publicly #242

Mordil opened this issue Dec 22, 2022 · 7 comments
Labels
semver/minor Adds new public API.

Comments

@Mordil
Copy link

Mordil commented Dec 22, 2022

I have my own test helpers for validating logging behavior in my library

after writing tests for #243... the test helpers are much nicer than what I wrote.

It'd be nice if the helpers were made public in a LoggingTestUtils module to be imported in my test targets...

@ktoso
Copy link
Member

ktoso commented Dec 22, 2022

Rather, we wanted to provide the LogCapture libs, like the one that distributed actors has implemented:

I forgot what that got stuck on, was it you @glbrntt or @fabianfett who was looking into this or am I misremembering?

We provided such for metrics, so we should do the same for log perhaps. For metrics it is: https://github.com/apple/swift-metrics-extras/tree/main/Sources/MetricsTestUtils which also was extracted from distributed actors cluster

@glbrntt
Copy link
Contributor

glbrntt commented Dec 22, 2022

gRPC does similar. I don't recall looking into making this a feature of swift-log though.

It would be great if we did have this though as it's a useful utility and annoying for folks to have to re-invent it each time they want it.

@tomerd
Copy link
Member

tomerd commented Dec 22, 2022

+1

@Mordil
Copy link
Author

Mordil commented Jun 22, 2023

Where are we at with this? Is this something that just needs a PR?

@ktoso
Copy link
Member

ktoso commented Jun 23, 2023

Just someone needs to do it, yes. If you're interested help here would be welcome.

It'd live in a LoggingTestKit the same as we do for metrics test kit.
You can base the implementation on what the distributed cluster does.

@ktoso ktoso added the semver/minor Adds new public API. label Jun 23, 2023
@Mordil
Copy link
Author

Mordil commented Jun 28, 2023

Awesome. I'll look into creating a submission next week while I take extra time off for the US holiday weekend

@brimworks
Copy link

This seems to have languished, so I put together this proposal: #316

If I get the thumbs up, then I'll put together a PR with that implementation. Please provide feedback in the above PR about the approach.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver/minor Adds new public API.
Projects
None yet
Development

No branches or pull requests

5 participants