Skip to content

1.12.0

Compare
Choose a tag to compare
@bsideup bsideup released this 24 Jul 08:27
1010b89

What's Changed

🚀 Features

  • Add DB2 module (#1611) @aguibert

    As a result of our collaboration with @aguibert and @irinadel from IBM, we're happy to bring DB2 support to Testcontainers 🎉 It of course works with the JDBC URL support too! It means you can spin up a real instance of DB2 in your tests with one line: jdbc:tc:db2:///databasename.
    For more info, check the module's page: https://www.testcontainers.org/modules/databases/db2/

  • Implement dependsOn for cross-container dependencies (#1404) @bsideup

    Ever wanted to wait for container B before starting container A? We got you covered 😎

    With the new dependsOn method, it is now possible to model a graph of dependencies between your containers:

    @Rule
    KafkaContainer kafka = new KafkaContainer();
    
    @Rule
    SchemaRegistryContainer schemaRegistryContainer = new SchemaRegistryContainer("5.2.1")
            .withKafka(kafka)
            .dependsOn(kafka);
  • Improve pull handling (#1320) @rnorth

    Pulling images is sometimes a long running process. And, as with every long running process, having some sort of a visualization could help understanding what is going on!

    Before:

    11:15:50.598 INFO  🐳 [ibmcom/db2express-c:latest] - Pulling docker image: ibmcom/db2express-c:latest. Please be patient; this may take some time but only needs to be done once.
    

    Oh yeah, it will take some time 😅

    After:

    19:34:25.198 INFO  🐳 [ibmcom/db2express-c:latest] - Pulling image
    19:34:25.198 INFO  🐳 [ibmcom/db2express-c:latest] - Pulling image layers:  0 pending,  0 downloaded,  0 extracted, (0 bytes/0 bytes)
    19:34:25.967 INFO  🐳 [ibmcom/db2express-c:latest] - Pulling image layers: 12 pending,  1 downloaded,  0 extracted, (32 bytes/? MB)
    19:34:27.363 INFO  🐳 [ibmcom/db2express-c:latest] - Pulling image layers: 11 pending,  2 downloaded,  0 extracted, (1 MB/? MB)
    19:34:58.519 ERROR 🐳 [ibmcom/db2express-c:latest] - Docker image pull has not made progress in 30s - aborting pull
    19:34:58.564 ERROR 🐳 [ibmcom/db2express-c:latest] - Failed to pull image: ibmcom/db2express-c:latest. Please check output of `docker pull ibmcom/db2express-c:latest`
    

    (Note that it detected a problem with pulling and reported it, hinting you how to debug it!)

  • Add RabbitMQ module (#1449) @martingreber

    Hey, 🐰 fans! How flexible do you think RabbitMQ can be? That flexible:

      RabbitMQContainer container = new RabbitMQContainer()
              .withVhost("vhost1")
              .withVhostLimit("vhost1", "max-connections", 1)
              .withVhost("vhost2", true)
              .withExchange("direct-exchange", "direct")
              .withExchange("topic-exchange", "topic")
              .withQueue("queue1")
              .withQueue("queue2", true, false, ImmutableMap.of("x-message-ttl", 1000))
              .withBinding("direct-exchange", "queue1")
              .withUser("user1", "password1")
              .withUser("user2", "password2", ImmutableSet.of("administrator"))
              .withPermission("vhost1", "user1", ".*", ".*", ".*")
              .withPolicy("max length policy", "^dog", ImmutableMap.of("max-length", 1), 1, "queues")
              .withPolicy("alternate exchange policy", "^direct-exchange", ImmutableMap.of("alternate-exchange", "amq.direct"))
              .withOperatorPolicy("operator policy 1", "^queue1", ImmutableMap.of("message-ttl", 1000), 1, "queues")
              .withPluginsEnabled("rabbitmq_shovel", "rabbitmq_random_exchange");
  • Allow JUnit Jupiter tests to be disabled when Docker is unavailable (#1530) @wilkinsona

    Thanks to our friends from Spring Boot (who also happened to use Testcontainers a lot 😁), it is now possible to skip JUnit Platform-based tests if Docker is not available:

    @Testcontainers(disabledWithoutDocker = true)
    class SomeIntegrationTest {
      // ...
    }
  • Fail fast if container_name is set in Docker Compose file (#1581) @bsideup

    Testcontainers does not support container_name property because it breaks the service discovery, but, before this change, the tests were failing without pointing to the problem.
    Thanks to the initial work from @mumukiller, it will fail fast if the property is presented.

  • Add new withDockerfile methods to ImageFromDockerfile (#1535) @aguibert

    ImageFromDockerfile should respect the .dockerignore file from now on.

  • Enable command override for PostgreSQLContainer (#938) @kellen

  • Add container stopping and stopped hooks (#1610) @jalaziz

  • Fail gracefully if no JDBC driver found (#1434) @rnorth

  • Simplify Kafka container by deferring the Kafka command (#1458) @bsideup

🧹 Housekeeping

  • Azure Pipelines for Windows testing (#1363) @bsideup

    This one is not a feature, but an exciting change! We now test every master build (and some PRs) on Windows!

    Since it requires running a real Windows machine, we have to host it ourselves.

    P.S. consider contacting us if you have a few spare Windows nodes ;)

🐛 Bug Fixes

📖 Documentation

📦 Dependency updates