-
-
Notifications
You must be signed in to change notification settings - Fork 96
Add interoperability smoke tests for Mastodon (non-strict) #598
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
sij411
wants to merge
8
commits into
fedify-dev:main
Choose a base branch
from
sij411:feat/smoke
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,683
−677
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
bf7b026
Add interoperability smoke tests for Mastodon
sij411 6faad08
Harden smoke test orchestrator and provisioning
sij411 386b7f2
Address review feedback on smoke test suite
sij411 c959f72
Update deno.lock
sij411 b8bf5dc
Simplify parseRecipient return type and call sites
sij411 c204bde
Address Codex review feedback on smoke tests
sij411 0f8a92a
Strengthen smoke test assertions and scenario isolation
sij411 2392533
Assert Accept round-trip in follow smoke test
sij411 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,93 @@ | ||
| # yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json | ||
| # | ||
| # Interoperability smoke tests. | ||
| # Spins up a Mastodon instance via Docker Compose and verifies that Fedify | ||
| # can correctly exchange ActivityPub messages with it. | ||
| # See: https://github.com/fedify-dev/fedify/issues/481 | ||
| name: smoke-mastodon | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| - next | ||
| - "*.*-maintenance" | ||
| workflow_dispatch: | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| smoke: | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 25 | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - uses: ./.github/actions/setup-mise | ||
|
|
||
| - name: Generate Mastodon secrets | ||
| run: | | ||
| IMAGE=ghcr.io/mastodon/mastodon:v4.3.9 | ||
| docker pull "$IMAGE" | ||
|
|
||
| SECRET1=$(docker run --rm "$IMAGE" bundle exec rails secret) | ||
| SECRET2=$(docker run --rm "$IMAGE" bundle exec rails secret) | ||
|
|
||
| { | ||
| echo "SECRET_KEY_BASE=$SECRET1" | ||
| echo "OTP_SECRET=$SECRET2" | ||
| docker run --rm "$IMAGE" bundle exec rails mastodon:webpush:generate_vapid_key \ | ||
| | grep -E '^[A-Z_]+=.+' | ||
| docker run --rm "$IMAGE" bundle exec rails db:encryption:init \ | ||
| | grep -E '^[A-Z_]+=.+' | ||
| } >> test/smoke/mastodon/mastodon.env | ||
|
|
||
| - name: Start database and redis | ||
| run: | | ||
| docker compose -f test/smoke/mastodon/docker-compose.yml up -d db redis | ||
| docker compose -f test/smoke/mastodon/docker-compose.yml exec -T db \ | ||
| sh -c 'until pg_isready -U mastodon; do sleep 1; done' | ||
|
|
||
| - name: Run DB setup and migrations | ||
| run: | | ||
| docker compose -f test/smoke/mastodon/docker-compose.yml run --rm -T \ | ||
| mastodon-web bundle exec rails db:setup | ||
| timeout-minutes: 5 | ||
|
|
||
| - name: Start Mastodon stack | ||
| run: docker compose -f test/smoke/mastodon/docker-compose.yml up --wait | ||
| timeout-minutes: 12 | ||
|
|
||
| - name: Provision Mastodon | ||
| run: bash test/smoke/mastodon/provision.sh | ||
|
|
||
| - name: Verify connectivity | ||
| run: | | ||
| echo "=== Harness health (from mastodon-web) ===" | ||
| docker compose -f test/smoke/mastodon/docker-compose.yml exec -T mastodon-web \ | ||
| curl -sf http://fedify-harness:3001/_test/health | ||
| echo " OK" | ||
|
|
||
| echo "=== Harness health (from mastodon-sidekiq) ===" | ||
| docker compose -f test/smoke/mastodon/docker-compose.yml exec -T mastodon-sidekiq \ | ||
| curl -sf http://fedify-harness:3001/_test/health | ||
| echo " OK" | ||
|
|
||
| - name: Run smoke tests | ||
| run: | | ||
| set -a && source test/smoke/.env.test && set +a | ||
| deno run --allow-net --allow-env --unstable-temporal \ | ||
| test/smoke/orchestrator.ts | ||
|
|
||
| - name: Collect logs on failure | ||
| if: failure() | ||
| run: | | ||
| echo "=== Docker Compose logs ===" | ||
| docker compose -f test/smoke/mastodon/docker-compose.yml logs --tail=500 | ||
|
|
||
| - name: Teardown | ||
| if: always() | ||
| run: docker compose -f test/smoke/mastodon/docker-compose.yml down -v | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.