Skip to content

Interoperability smoke test suite #481

@dahlia

Description

@dahlia

Summary

As a server framework, Fedify's core value lies in its ability to correctly interoperate with other ActivityPub implementations in the Fediverse. Currently, we rely on unit tests and manual testing, but we lack an automated, systematic way to verify E2E interoperability, similar to Node.js's CITGM (canary in the gold mine).

This issue proposes creating a new CI workflow dedicated to running smoke tests against live instances of major ActivityPub servers (e.g., Mastodon, Misskey) to ensure our federation logic is robust and compatible.

Proposed solution

The plan involves three main components:

  1. CI workflow: A GitHub Actions workflow that uses docker-compose to spin up services for:
    • One or more target ActivityPub servers (e.g., a Mastodon instance).
    • Our “Fedify test harness” application.
  2. Fedify test harness: Since Fedify is a library, we will create a minimal, lightweight Fedify application within this repository (e.g., under test/smoke-harness/). Its sole purpose is to serve as an endpoint for these tests.
  3. CI orchestrator: The main test script (e.g., a Deno script) that orchestrates the E2E test.

Implementation details

This E2E test cannot only test Fedify. It must verify that actions are correctly sent, received, and interpreted by both sides.

1. Fedify test harness app

  • It will be a minimal fedify app with basic handlers (e.g., for Actor, Inbox, Outbox).
  • It will use a simple data store (e.g., in-memory or Deno KV).
  • Crucially, it will expose internal “backdoor” APIs for the test orchestrator (e.g., POST /_test/follow, POST /_test/create-note, GET /_test/get-latest-inbox-item).

2. CI orchestrator and verification

The orchestrator script will manage the entire test flow by communicating with both our test harness and the target server's API.

Example scenario: Fedify → Mastodon (Create(Note))
  1. Setup: The orchestrator uses Mastodon's API (tootctl or REST) to create a test user (@[email protected]) and get an API token.
  2. Action: The orchestrator calls our harness's backdoor API: POST /_test/create-note?content=...
  3. Federation: Our harness app, using fedify, sends a Create activity to @mastodon-user's inbox.
  4. Verification: The orchestrator uses the Mastodon API token to poll @mastodon-user's home timeline (GET /api/v1/timelines/home).
  5. Assert: The test passes if the new note from our Fedify harness appears on the Mastodon user's timeline within a timeout.
Example scenario: Mastodon → Fedify (reply)
  1. Action: The orchestrator uses the Mastodon API to post a reply to the note from the previous test.
  2. Federation: The Mastodon server sends a Create (reply) activity to our Fedify harness's inbox.
  3. Verification: The orchestrator calls our harness's backdoor API: GET /_test/get-latest-inbox-item.
  4. Assert: The test passes if the harness returns the reply activity from Mastodon.

CI strategy

  • These tests will be too long-running and resource-intensive to run on every PR.
  • They should be configured to run on pushes to:
    • main
    • next
    • Maintenance branches (e.g., *.*-maintenance)
  • We will also add a workflow_dispatch trigger to allow them to be run manually on a specific PR branch when necessary (e.g., when federation code is changed).

Phased rollout (target implementations)

We will add implementations gradually.

  • Phase 1 (Core microblogging):
    • Mastodon (De-facto standard)
    • Misskey (Major alternative with different characteristics)
  • Phase 2 (Major stacks & types):
    • Akkoma/Pleroma (Elixir-based)
    • Pixelfed (Media-focused, Image/Video objects)
  • Phase 3 (Service diversity):
    • PeerTube (Video / Group actor for channels)
    • Lemmy / Kbin (Community / Group interaction)
    • WriteFreely (Article objects)

Acceptance criteria (for this task)

  • A CI workflow is created.
  • A minimal Fedify test harness app is built within the repo.
  • The workflow successfully runs E2E tests (e.g., Follow, Create(Note), reply) against Mastodon.
  • The workflow is configured to run on pushes to main, next, and *.*-maintenance branches, and on workflow_dispatch.

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions