Testcontainers logo

Testcontainers

A library that integrates Docker with testing libs - for databases, Selenium web browsers, or anything else that can run in a Docker container
85
58
+ 1
0

What is Testcontainers?

It is a Java library that supports JUnit tests, providing lightweight, throwaway instances of common databases, Selenium web browsers, or anything else that can run in a Docker container.
Testcontainers is a tool in the Container Tools category of a tech stack.
Testcontainers is an open source tool with 7.7K GitHub stars and 1.6K GitHub forks. Here’s a link to Testcontainers's open source repository on GitHub

Who uses Testcontainers?

Companies
22 companies reportedly use Testcontainers in their tech stacks, including technology, Backbase, and Bunch.

Developers
57 developers on StackShare have stated that they use Testcontainers.

Testcontainers Integrations

Docker, MySQL, PostgreSQL, JUnit, and Oracle are some of the popular tools that integrate with Testcontainers. Here's a list of all 6 tools that integrate with Testcontainers.
Decisions about Testcontainers

Here are some stack decisions, common use cases and reviews by companies and developers who chose Testcontainers in their tech stack.

Joshua Dean Küpper
CEO at Scrayos UG (haftungsbeschränkt) · | 12 upvotes · 345.2K views

We've already been monitoring Agones for a few years now, but we only adapted Kubernetes in mid 2021, so we could never use it until then. Transitioning to Kubernetes has overall been a blast. There's definitely a steep learning curve associated with it, but for us, it was certainly worth it. And Agones plays definitely a part in it.

We previously scheduled our game servers with Docker Compose and Docker Swarm, but that always felt a little brittle and like a really "manual" process, even though everything was already dockerized. For matchmaking, we didn't have any solution yet.

After we did tons of local testing, we deployed our first production-ready Kubernetes cluster with #kubespray and deployed Agones (with Helm) on it. The installation was very easy and the official chart had just the right amount of knobs for us!

The aspect, that we were the most stunned about, is how seamless Agones integrates into the Kubernetes infrastructure. It reuses existing mechanisms like the Health Pings and extends them with more resource states and other properties that are unique to game servers. But you're still free to use it however you like: One GameServer per Game-Session, one GameServer for multiple Game-Sessions (in parallel or reusing existing servers), custom allocation mechanisms, webhook-based scaling, ... we didn't run into any dead ends yet.

One thing, that I was a little worried about in the beginning, was the SDK integration, as there was no official one for Minecraft/Java. And the two available inofficial ones didn't satisfy our requirements for the SDK. Therefore, we went and developed our own SDK and ... it was super easy! Agones does publish their Protobuf files and so we could generate the stubs with #Protoc. The existing documentation regarding Client-SDKs from Agones was a great help in writing our own documentation for the interface methods.

And they even have excellent tooling for testing your own SDK implementations. With the use of Testcontainers we could just spin up the local SDK testing image for each of the integration tests and could confirm that our SDK is working fine. We discovered a very small inconsistency for one of the interface methods, submitted an issue and a corresponding PR and it was merged within less than 24 hours.

We've now been using Agones for a few months and it has proven to be very reliable, easy to manage and just a great tool in general.

See more

Testcontainers's Features

  • Data access layer integration tests
  • Application integration tests
  • UI/Acceptance tests

Testcontainers Alternatives & Comparisons

What are some alternatives to Testcontainers?
Arquillian
It is an integration and functional testing platform that can be used for Java middleware testing. With the main goal of making integration (and functional) tests as simple to write as unit tests, it brings the tests to the runtime environment, freeing developers from managing the runtime from within the test.
Docker Compose
With Compose, you define a multi-container application in a single file, then spin your application up in a single command which does everything that needs to be done to get it running.
Kubernetes
Kubernetes is an open source orchestration system for Docker containers. It handles scheduling onto nodes in a compute cluster and actively manages workloads to ensure that their state matches the users declared intentions.
Rancher
Rancher is an open source container management platform that includes full distributions of Kubernetes, Apache Mesos and Docker Swarm, and makes it simple to operate container clusters on any cloud or infrastructure platform.
Docker Swarm
Swarm serves the standard Docker API, so any tool which already communicates with a Docker daemon can use Swarm to transparently scale to multiple hosts: Dokku, Compose, Krane, Deis, DockerUI, Shipyard, Drone, Jenkins... and, of course, the Docker client itself.
See all alternatives

Testcontainers's Followers
58 developers follow Testcontainers to keep up with related blogs and decisions.