Making your own Making yourmodule own Testcontainers for fun and profit! Testcontainers module for fun and profit!

What is productivity? The developer-centric approach to measuring and improving productivity. Abi Noda, DX Margaret-Anne Storey, University of Victoria Nicole Forsgren, Microsoft Research Michaela Greiler, DX https://queue.acm.org/detail.cfm?id=3595878

TESTS

Test dependencies as code Testcontainers is an open source library for providing ephemeral, lightweight instances of test dependencies. var redis = new GenericContainer(“redis:6-alpine”).withExposedPorts(6379)

Testcontainers: Test dependencies with real services wrapped in Docker containers var granite = new GenericContainer(“redhat/granite-7b-lab-gguf”).withCommand(“—serve”) Testcontainers Library Testcontainers Desktop Testcontainers Cloud Fast, reasistic, cost-effective dependencies Better local development and debugging experience Operationalize and roll out Testcontainers across the teams

Testcontainers modules Test against any database, message broker, browser… or just about anything that runs in a Docker container!

start.spring.io has it :)

Testcontainers module functionality Container & Service Configuration Lifecycle API Convenience methods

protected void configure()

Convenience methods

TEST! 🔥🔥 🔥 DEMO TIME

Custom Commands

KafkaContainer this.setCommand(new String[]{“-c”, “while [ ! -f /testcontainers_start.sh ]; do sleep 0.1; done; /testcontainers_start.sh”});

KafkaContainer this.setCommand(new String[]{“-c”, “while [ ! -f /testcontainers_start.sh ]; do sleep 0.1; done; /testcontainers_start.sh”});

Networks

Docker configuration

Tools in containers

Tools in containers

TEST! 🔥🔥 🔥 DEMO TIME

https://github.com/testcontainers/java-module-worksh op https://github.com/testcontainers/workshop https://testcontainers.com/desktop https://slack.testcontainers.com

Booth 35!