Skip to content

RFC: consolidate integration test harnesses #2082

@sanity

Description

@sanity

Summary

Over the last few months we accidentally accumulated multiple integration / system-test harnesses:

Harness Location Language Primary Scope Strengths Current Gaps / Notes
freenet_test macro + TestContext crates/freenet-macros, crates/core/src/test_utils.rs Rust (in-tree) freenet-core integration tests (connectivity.rs, operations.rs, etc.) Built into core repo, async aware, produces rich diagnostics/events Lives inside freenet-core so other repos (River, apps) can’t reuse it; still maintains its own node bootstrap pipeline separate from newer crates
freenet-test-network crate ~/code/freenet/freenet-test-network Rust crate Generic gateway/peer launcher; used by new diagnose_connectivity.rs, River tests, ping diagnostics Repo-agnostic, exposes builder API, preserves temp dirs/logs, easy to script Exists out-of-tree, so freenet-core still has parallel logic (macro) and existing harnesses haven’t migrated; feature coverage not yet on par with TestContext (event aggregation, TestLogger, etc.)
Ubertest crates/core/tests/ubertest.rs Rust + external riverctl End-to-end River scenario on freenet-core Exercises real app flows, validates River compatibility Duplicates config/build logic, requires manual deps, hasn’t adopted the crate/macro
Gateway Test Framework freenet-testing-tools/gateway-testing Python Release/pre-release test suite, extended soak runs Battle-tested, produces markdown/log bundles, supports multi-room/stability modes Entirely separate stack (Python + scripts), hard to keep in sync with Rust harness improvements
Ping app harness apps/freenet-ping/app/tests/run_app.rs Rust Manual ping scenarios (partial connectivity, diagnostics) Deep instrumentation of ping flows, integrates with app build Reimplements node start/diagnostics, only usable from ping repo
River CLI tests river/cli/tests/message_flow.rs Rust River message flow over a freenet-core checkout Runs against actual River client binaries Maintains another copy of cluster start/teardown logic

This fragments fixes (like Nacho’s request on PR #2081) and causes new harnesses to pop up whenever the existing ones don’t fit (“the macro lives in freenet-core so River can’t use it”, “gateway-testing is Python”, etc.).

Proposal / Discussion Starters

  1. Identify a single reusable foundation – likely freenet-test-network, since it can be imported by any crate. Can we teach the freenet_test macro/TestContext to use it under the hood so core tests migrate without losing diagnostics? Once that happens, we could drop the bespoke bootstrap logic from ubertest, ping, River, etc.
  2. Decide what survives:
    • Keep freenet-test-network as the canonical launcher?
    • Migrate the macro/TestContext to wrap it (and keep the nice ergonomics like ctx.node("peer1"))?
    • Treat gateway-testing Python as “release-only” and avoid spinning up new Python stacks?
  3. Migration path – e.g. prioritize porting Ubertest, ping manual tests, and River message-flow tests onto the shared crate, then delete their inline launchers.
  4. Feature gaps – list anything the shared harness must support (event aggregation, TestLogger, River-specific hooks, artifact dumps) before consolidation.

Comments/thoughts welcome on:

  • Which harness should be the canonical one?
  • What blockers do River/ping teams have with adopting it?
  • Whether gateway-testing stays for release soak once equivalent Rust coverage exists.

Let’s use this issue to track the decision + migration plan so future PRs don’t add yet another bespoke harness.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-developer-xpArea: developer experienceE-hardExperience needed to fix/implement: Hard / a lotS-needs-designStatus: Needs architectural design or RFCT-trackingType: Meta-issue tracking multiple related issues

    Type

    No type

    Projects

    Status

    Triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions