-
-
Notifications
You must be signed in to change notification settings - Fork 88
Description
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:
- CI workflow: A GitHub Actions workflow that uses
docker-composeto spin up services for:- One or more target ActivityPub servers (e.g., a Mastodon instance).
- Our “Fedify test harness” application.
- 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. - 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
fedifyapp with basic handlers (e.g., forActor,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))
- Setup: The orchestrator uses Mastodon's API (
tootctlor REST) to create a test user (@[email protected]) and get an API token. - Action: The orchestrator calls our harness's backdoor API:
POST /_test/create-note?content=... - Federation: Our harness app, using
fedify, sends aCreateactivity to@mastodon-user's inbox. - Verification: The orchestrator uses the Mastodon API token to poll
@mastodon-user's home timeline (GET /api/v1/timelines/home). - 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)
- Action: The orchestrator uses the Mastodon API to post a reply to the note from the previous test.
- Federation: The Mastodon server sends a
Create(reply) activity to our Fedify harness's inbox. - Verification: The orchestrator calls our harness's backdoor API:
GET /_test/get-latest-inbox-item. - 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_dispatchtrigger 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/Videoobjects)
- Phase 3 (Service diversity):
- PeerTube (Video /
Groupactor for channels) - Lemmy / Kbin (Community /
Groupinteraction) - WriteFreely (
Articleobjects)
- PeerTube (Video /
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*.*-maintenancebranches, and onworkflow_dispatch.