Integration-testing GoBlog’s ActivityPub implementation
-
Recently, I noticed in my blog database export that a couple of ActivityPub users unfollowed. All at the same time. It was strange. Until I noticed all were GoToSocial (GTS) users. In the logs I found the reason: GoBlog failed to deliver some updates to the users, and so the accounts were marked as dead and removed after twenty failed tries.
This sent me on a new journey to check GoBlog’s ActivityPub implementation. First I fixed HTTP signatures to be compatible again with GTS. I also added a test with GTS’s HTTP signature library to prevent that from happening again.
But now, I also added more complete integration tests: the tests will start a GTS container in a Docker network. Another Docker container with Caddy inside proxies requests back to GoBlog on an example domain. This way I can completely test ActivityPub interactions. All local, no public access needed. And it also runs in GitHub Actions, verifying no commit is breaking ActivityPub.
I hope that’s a great base for implementing more ActivityPub functionality, such as following people (I still have to think about the UX here; maybe the received posts can be exported as a private RSS/JSON feed?) or the option to move actors (which might help with the domain migration I might want to do one day).
If you are interested in how I implemented this without a big framework like TestContainers, take a look at this file. AI helped implement this, but I took over the wheel after AI failed after hours of trying. Real intelligence sometimes still beats artificial ones.

-
T tag-activitypub@relay.fedi.buzz shared this topic
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login