swift-server / swift-server/async-http-client

support fake I/O layer

Open
#394 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

kind/enhancement
Dominant language
Swift
Stars
1.1k
Forks
156
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing AHC's HTTPService and the Tier 1 suggestion in issue #392 to understand the intended abstraction. Define how a fake I/O layer can handle any AHC request without network connections or DNS lookups, and verify that a fake HTTPService can support library tests without a real server.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift
Domain
backend-api-design, testing
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.