Skip to content

test(iroh-relay): integration tests for embedding the relay#4206

Merged
Frando merged 3 commits intomainfrom
Frando/relay-embed-tests
May 6, 2026
Merged

test(iroh-relay): integration tests for embedding the relay#4206
Frando merged 3 commits intomainfrom
Frando/relay-embed-tests

Conversation

@Frando
Copy link
Copy Markdown
Member

@Frando Frando commented Apr 28, 2026

Description

Adds two integration tests that demonstrate embedding the relay inside an external HTTP server:

  • tests/relay_hyper.rs: serves a RelayServiceWithNotify directly via hyper.
  • tests/relay_axum.rs: uses axum, its Router and its WebSocketUpgrade for the /relay route. Then passes the client stream to the relay Clients. Does not use RelayServeWthNotfy.

Also exports the type aliases iroh_relay::server::http_server::BytesBody, HyperError, and HyperResult so that external code can name the response and error types of RelayServiceWithNotify's hyper service.

Change checklist

  • Self-review.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 28, 2026

Documentation for this PR has been generated and is available at: https://n0-computer.github.io/iroh/pr/4206/docs/iroh/

Last updated: 2026-05-06T09:05:31Z

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 28, 2026

Netsim report & logs for this PR have been generated and is available at: LOGS
This report will remain available for 3 days.

Last updated for commit: 1d3be4a

@n0bot n0bot Bot added this to iroh Apr 29, 2026
@github-project-automation github-project-automation Bot moved this to 🚑 Needs Triage in iroh Apr 29, 2026
@Frando Frando force-pushed the Frando/relay-embed-tests branch 2 times, most recently from eb60061 to ba16107 Compare April 29, 2026 10:39
@Frando Frando marked this pull request as ready for review April 29, 2026 10:43
@Frando Frando force-pushed the Frando/relay-embed-tests branch from ba16107 to a8fa1a9 Compare May 5, 2026 14:19
Frando added 2 commits May 6, 2026 10:31
Adds two integration tests that demonstrate embedding the relay
inside an external HTTP server.

`tests/relay_hyper.rs` serves [`RelayServiceWithNotify`] directly
via hyper, with a `dispatch` function that routes `/ping` to a
hand-rolled probe response and `/relay` through a freshly
constructed `RelayServiceWithNotify` per request.

`tests/relay_axum.rs` hosts the relay alongside an axum router
on a single port, using axum's `WebSocketUpgrade` extractor and
bridging the resulting socket to iroh-relay's [`BytesStreamSink`]
via a small adapter modeled after kitsune2's `iroh_relay_axum.rs`.

Promotes `iroh_relay::server::http_server::BytesBody`, `HyperError`,
and `HyperResult` from `pub(super)` to `pub` so external code can
name the response and error types of `RelayServiceWithNotify`'s
hyper service.
@Frando Frando force-pushed the Frando/relay-embed-tests branch from 27762ea to 7985093 Compare May 6, 2026 09:03
@Frando Frando merged commit 88c9eed into main May 6, 2026
35 of 36 checks passed
@github-project-automation github-project-automation Bot moved this from 🚑 Needs Triage to ✅ Done in iroh May 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

2 participants