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. 😅

Interactions & Comments