end-to-end/federation/scenario-mastodon/TEST_INSTRUCTION.md
famfo a57c631fae feat(federation): add scenario-mastodon setup and teardown (#1274)
2/5 taken out of #1269

This patch adds the setup and teardown of Mastodon for use in the end-to-end tests

Co-Authored-By: zam <mirco.zachmann@meissa.de>
Co-Authored-By: erik <erik.seiert@meissa-gmbh.de>
Co-Authored-By: Michael Jerger <michael.jerger@meissa-gmbh.de>

Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/1274
Reviewed-by: earl-warren <earl-warren@noreply.code.forgejo.org>
Reviewed-by: Beowulf <beowulf@noreply.code.forgejo.org>
Co-authored-by: famfo <famfo@famfo.xyz>
Co-committed-by: famfo <famfo@famfo.xyz>
2026-01-05 14:34:58 +00:00

1.4 KiB

Manual testing

  1. compile forgejo binary to test on a debian/ubuntu system
  2. start applications
    • local forgejo:
      cd federation/scenario-mastodon
      # create cert & startup & create test accounts
      SCENARIO_DIR="." ./setup.sh
      # Mastodon password in "/tmp/forgejo-end-to-end/federation_scenario-mastodon-env"
      # Bind forgejo to localhost:3003 and set the domain to `forgejo`
      
    • containerized forgejo:
      cd federation/scenario-mastodon
      # Generate self-signed certs on first run
      source ./functions.sh
      generate_certs forgejo "./resources/certs"
      mv "./resources/certs/forgejo"* "forgejo/certs"
      
      # Setup container
      export FORGEJO_PATH="/path/to/forgejo/binary"
      export COMPOSE_PROFILES="forgejo_container"
      export MASTODON_HOST="mastodon-app"
      
      podman-compose up -d
      podman-compose exec forgejo-app bash -c "/init/create_test_account.sh"
      # Mastodon password is the last line of the output
      podman-compose exec mastodon-app bash -c "/init/create_test_account.sh"
      
  3. login to mastodon: http://localhost:4000
    1. test@localhost - password from start app.
  4. search for forgejo user: https://forgejo/api/v1/activitypub/user-id/1
  5. Press follow
  6. FYI:
    1. login to forgejo: http://localhost:3003/
    2. me - me
    3. swagger-uri: http://localhost:3003/api/swagger#/activitypub