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

support fake I/O layer #394

Open
weissi opened this issue Jul 7, 2021 · 1 comment
Open

support fake I/O layer #394

weissi opened this issue Jul 7, 2021 · 1 comment
Labels
kind/enhancement Improvements to existing feature.

Comments

@weissi
Copy link
Contributor

weissi commented Jul 7, 2021

Many libraries depend on AHC which is great. The downside is that that means to test these libraries they either need to provide a layer which allows to fake AHC or we have to spin up an actual server (say on localhost) to write integration tests with these libraries. That's super tedious and sometimes impossible.

AHC should allow to take a fake I/O layer which allows to run any AHC request without ever doing a network connection or a DNS lookup.

In the #392 suggestion, that would live in Tier 1. So for testing, one could create a fake HTTPService which never actually speaks HTTP over a network protocol.

@weissi weissi added kind/enhancement Improvements to existing feature. help wanted labels Jul 7, 2021
@weissi
Copy link
Contributor Author

weissi commented Jul 7, 2021

Chatting about this with @fabianfett, this should probably be a feature for the middle ware feature (#393). So if the middle wares are good enough, it should be possible to do anything that can happen with a request without ever having to create a network connection (Channel). If that's possible, then we don't need a real fake I/O layer.

One question that would arise is that it'd be useful to switch to a fake AHC in Tier 1 (to share it with other libraries) but in #393 I suggested that the middlewares live at Tier 2. Maybe we should accept middlewares in both Tier 1 & 2?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement Improvements to existing feature.
Projects
None yet
Development

No branches or pull requests

2 participants