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
90
59
+ 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 8K GitHub stars and 1.6K GitHub forks. Here’s a link to Testcontainers's open source repository on GitHub

Who uses Testcontainers?

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

Developers
61 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 · 353.4K 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.
JavaScript
JavaScript is most known as the scripting language for Web pages, but used in many non-browser environments as well such as node.js or Apache CouchDB. It is a prototype-based, multi-paradigm scripting language that is dynamic,and supports object-oriented, imperative, and functional programming styles.
Git
Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency.
GitHub
GitHub is the best place to share code with friends, co-workers, classmates, and complete strangers. Over three million people use GitHub to build amazing things together.
See all alternatives

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