Skip to content

Add test for comment federation on cached posts#639

Merged
akirk merged 10 commits into
mainfrom
test-comment-federation
Apr 4, 2026
Merged

Add test for comment federation on cached posts#639
akirk merged 10 commits into
mainfrom
test-comment-federation

Conversation

@akirk

@akirk akirk commented Apr 4, 2026

Copy link
Copy Markdown
Owner

Summary

  • Enable ActivityPub plugin in CI (PHP 8.3+) by checking out Automattic/wordpress-activitypub as a sibling directory — all ActivityPubTest tests were previously skipped
  • Add test_comment_on_cached_post_federation() to verify that commenting on a cached friend_post_cache post produces the correct remote inReplyTo URL for ActivityPub federation
  • Fix mastodon.local missing from the test host allowlist, which caused all AP test feed creation to silently fail

Test plan

  • CI runs ActivityPub-dependent tests on PHP 8.3+ instead of skipping them
  • All 6 PHP versions pass (7.4, 8.0, 8.1, 8.2, 8.3, 8.4)
  • The new test verifies: get_permalink() returns the remote GUID, should_comment_be_federated() returns true, and the transformer's inReplyTo matches the remote URL
Changelog
  • Automatically create a changelog entry from the details below

Type

  • Added
  • Changed
  • Fixed
  • Removed

Message

Add ActivityPub integration tests to CI and test for comment federation on cached posts.

@github-actions

github-actions Bot commented Apr 4, 2026

Copy link
Copy Markdown
Contributor

Test this PR in WordPress Playground

You can test this pull request directly in WordPress Playground:

Launch WordPress Playground

This will install and activate the plugin with the changes from this PR.

akirk added 9 commits April 4, 2026 15:33
…b tests in CI

The CI was skipping all ActivityPub-related tests because the plugin
wasn't available. This adds a checkout step for the ActivityPub plugin
and a new test that verifies commenting on a cached friend post produces
the correct inReplyTo URL for federation.
actions/checkout doesn't allow paths outside the workspace, so checkout
inside and symlink to the sibling directory the bootstrap expects.
doctrine/instantiator 2.1.0 uses PHP 8.3 typed constants, so the
ActivityPub tests can only run on PHP 8.3+.
The ActivityPub tests use mastodon.local as the actor host, but it was
missing from the friends_host_is_valid allowlist. This was never caught
because without the AP plugin loaded, set_up() skips early. With AP
loaded in CI, save_feed() rejects the URL as invalid.
@akirk akirk force-pushed the test-comment-federation branch from 5d6bb5b to b079a09 Compare April 4, 2026 13:33
@akirk akirk merged commit dae8266 into main Apr 4, 2026
@akirk akirk deleted the test-comment-federation branch April 4, 2026 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant