Add interoperability smoke tests for Mastodon#598
Add interoperability smoke tests for Mastodon#598sij411 wants to merge 5 commits intofedify-dev:mainfrom
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request establishes a robust suite of interoperability smoke tests for the Fedify project, specifically targeting integration with Mastodon. By setting up a dedicated CI workflow, a specialized Fedify test harness, and an orchestrator for end-to-end scenarios, the changes ensure that Fedify's federation capabilities are validated against a widely used ActivityPub platform. This significantly enhances confidence in Fedify's ability to communicate effectively within the fediverse. Highlights
Changelog
Ignored Files
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces an extensive and well-designed interoperability smoke test suite for Mastodon. The use of Docker Compose to spin up the full stack is robust, and the workarounds for testing federation over HTTP are clever. The test harness and orchestrator are well-structured. I've identified a couple of opportunities to reduce code duplication in the new test files, which will improve their long-term maintainability. Overall, this is a great addition for ensuring Fedify's compatibility with Mastodon.
Codecov Report✅ All modified and coverable lines are covered by tests. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Adds a Mastodon-focused interoperability smoke test suite to validate Fedify’s federation behavior end-to-end in CI, aligning with the Phase 1 plan in issue #481.
Changes:
- Introduces a GitHub Actions workflow that boots a Mastodon stack + Fedify harness via Docker Compose and runs Deno-driven E2E scenarios.
- Adds a minimal Fedify “harness” app with federation endpoints and backdoor test-control APIs.
- Adds Mastodon provisioning scripts/config to create a test user, seed remote account data, and generate an API token for orchestrated scenarios.
Reviewed changes
Copilot reviewed 12 out of 14 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
.github/workflows/smoke-mastodon.yml |
CI workflow to generate Mastodon secrets, start stack, provision, run orchestrator, and collect logs. |
test/smoke/orchestrator.ts |
Deno E2E driver for follow/create/reply/unfollow scenarios between Mastodon and the harness. |
test/smoke/harness/main.ts |
HTTP server wiring: routes /_test/* to backdoor and everything else to federation fetch handler. |
test/smoke/harness/federation.ts |
Minimal Fedify federation setup (actor + inbox listeners) for the harness. |
test/smoke/harness/backdoor.ts |
Backdoor endpoints to reset state and initiate follow/unfollow/create-note actions. |
test/smoke/harness/store.ts |
In-memory inbox activity store used by backdoor endpoints. |
test/smoke/harness/deno.json |
Harness workspace config placeholder. |
test/smoke/mastodon/docker-compose.yml |
Defines Mastodon (web/sidekiq) + db/redis + fedify-harness services on a shared network. |
test/smoke/mastodon/mastodon.env |
Baseline Mastodon env config used by Compose (with secrets appended in CI). |
test/smoke/mastodon/provision.sh |
Provisions Mastodon user/token and pre-registers the harness account/key and initial follow relationship. |
test/smoke/mastodon/disable_force_ssl.rb |
Disables Rails force_ssl to allow HTTP in production-mode Mastodon container. |
deno.json |
Adds test/smoke/harness to the Deno workspace members. |
.gitignore |
Ignores generated smoke-test artifacts (e.g., .env.test, logs). |
b0264f4 to
eeaa4f7
Compare
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces an extensive interoperability smoke test suite for Mastodon, which is a great addition for ensuring Fedify's compatibility. The setup using Docker Compose, a test harness, and an orchestrator is well-thought-out. My review focuses on ensuring the new test infrastructure is correct and maintainable. I've found one critical issue regarding an invalid Docker image version that would prevent the tests from running, and a medium-severity suggestion to improve code clarity in the test harness.
Add an end-to-end smoke test suite that spins up a Mastodon instance via Docker Compose and verifies that Fedify can correctly exchange ActivityPub messages with it. The suite includes a lightweight Fedify test harness that runs inside the Docker network alongside Mastodon, and an orchestrator that drives six scenarios through the Mastodon API and harness backdoor endpoints: - Mastodon → Fedify (Follow) - Fedify → Mastodon (Follow) - Fedify → Mastodon (Create Note) - Mastodon → Fedify (Reply) - Mastodon → Fedify (Unfollow) - Fedify → Mastodon (Unfollow) Each follow scenario includes precondition checks (ensureNotFollowing / assertNotFollowing) to verify the relationship starts clean. Mastodon-specific files live in test/smoke/mastodon/ to support adding other server targets (e.g. Misskey) in sibling directories later. See: fedify-dev#481 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Use shared setup-mise action instead of inlining jdx/mise-action
- Validate required env vars at startup with clear error messages
- Derive harness host from HARNESS_ORIGIN instead of hardcoding
- Pass HARNESS_ORIGIN as env var in provision.sh to avoid shell
expansion in Ruby heredoc
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Extract parseRecipient helper in backdoor.ts to reduce duplication
- Extract pollHarnessInbox helper in orchestrator.ts to reduce
duplication and centralize inbox polling
- Make poll() catch transient errors and retry instead of aborting,
include last error message on timeout
- Fix workflow name reference in mastodon.env comment
- Pin Deno Docker image to 2.7.1 to match mise.toml
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove redundant `id` field from parseRecipient and use explicit destructuring at call sites for clearer data flow. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Summary
Implements the Phase 1 (Mastodon) interoperability smoke test suite described
in #481.
What this adds
CI workflow (
.github/workflows/smoke-mastodon.yml)A GitHub Actions workflow that spins up a full Mastodon stack (web, sidekiq,
PostgreSQL, Redis) alongside a Fedify test harness via Docker Compose, then
runs E2E federation scenarios.
When it runs:
main,next, and*.*-maintenancebranchesworkflow_dispatch(manual trigger for testing specific branches)It does not run on PRs, as the issue notes these tests are too
long-running and resource-intensive for every PR.
Fedify test harness (
test/smoke/harness/)A minimal Fedify application that runs inside the Docker network. It
exposes:
/_test/reset,/_test/inbox,/_test/follow,/_test/unfollow,/_test/create-note,/_test/health)Orchestrator (
test/smoke/orchestrator.ts)A Deno script that drives 6 E2E scenarios through both the Mastodon API
and harness backdoor endpoints:
Each follow scenario includes precondition checks (
ensureNotFollowing/assertNotFollowing) that verify the relationship starts clean beforeexercising the follow path.
Directory structure
Mastodon-specific files live in
test/smoke/mastodon/so that futureserver targets (e.g., Misskey for Phase 1, Akkoma for Phase 2) can be
added as sibling directories sharing the same harness and orchestrator
infrastructure.
Acceptance criteria (from the issue)
Follow,Create(Note), reply) pass against Mastodonmain,next,*.*-maintenance, andon
workflow_dispatchTest plan
actsmoke-mastodonpasses on push tomainRelated to #481
🤖 Generated with Claude Code