Integration testing with Docker and testcontainers #92
andregasser
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I was able to get a specific Mastodon instance version running in Docker, using a docker-compose.yml. I was basically following the guide published here: https://www.raeffs.dev/blog/self-hosting/2022-11-11-mastodon-with-docker/
My current plan is to build some sort of JUnit5-based integration tests that use testcontainers (https://https://www.testcontainers.org/) with the Docker compose module (https://www.testcontainers.org/modules/docker_compose/) to spin up specific versions of Mastodon (e.g. 3.5.0, 4.0.2, ...), invoke some library calls against that instance to see whether our request pass / fail. Doing so, we could easily verify, whether our calls are really working fine in a close-to-realistic environment.
I see some nice advantages when doing this:
I think it would be cool if we coudl build a first version of a JUnit 5 test class that invokes some API calls
against the latest Mastodon 4.0.2 instance.
In the beginning, we could run those tests manual for verification purposes, later we could add them as a GitHub check, as soon as they are stable enough.
Another nice side effect of having Mastodon instances running in Docker is that we can use these to extract real API responses for our existing tests.
Beta Was this translation helpful? Give feedback.
All reactions