TestContainers v1.12.0 Release Notes

Release Date: 2019-07-24 // almost 5 years ago
  • 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:

    @RuleKafkaContainer kafka = new KafkaContainer();@RuleSchemaRegistryContainer 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

    • ๐Ÿ‘Œ Improve splitting of SQL scripts into statements (#1627) @rnorth
    • โœ… catch exception when trying to kill dead container (#1420) @chungngoops

    ๐Ÿ“š ๐Ÿ“– Documentation

    โšก๏ธ ๐Ÿ“ฆ Dependency updates

    • โฌ†๏ธ Upgrade duct-tape library (#1433) @rnorth
    • โฌ†๏ธ Upgrade localstack and enable new services (#1504) @rnorth
    • โฌ†๏ธ Bumped up default version of Confluent Platform to the current 5.2.1 (Kafka container) (#1446) @wlsc
    • โฌ†๏ธ Bump docker-java from 3.1.0-rc-4 to 3.1.5 in /core (#1649) @dependabot-preview @bsideup
    • โฌ†๏ธ Bump mysql-connector-java from 8.0.16 to 8.0.17 in /modules/mysql (#1633) @dependabot-preview
    • โฌ†๏ธ Bump aws-java-sdk-sqs from 1.11.594 to 1.11.597 in /modules/localstack (#1654) @dependabot-preview
    • โฌ†๏ธ Bump junit-jupiter-api from 5.5.0 to 5.5.1 in /modules/junit-jupiter (#1638) @dependabot-preview
    • โฌ†๏ธ Bump junit-jupiter-engine from 5.5.0 to 5.5.1 in /modules/junit-jupiter (#1642) @dependabot-preview
    • โฌ†๏ธ Bump neo4j from 3.5.7 to 3.5.8 in /modules/neo4j (#1640) @dependabot-preview
    • โฌ†๏ธ Bump amqp-client from 5.7.1 to 5.7.2 in /core (#1588) @dependabot-preview
    • โฌ†๏ธ Bump cucumber-junit from 4.5.4 to 4.6.0 in /examples (#1619) @dependabot-preview
    • โฌ†๏ธ Bump cucumber-java from 4.5.4 to 4.6.0 in /examples (#1620) @dependabot-preview
    • โฌ†๏ธ Bump aws-java-sdk-sqs from 1.11.479 to 1.11.594 in /modules/localstack (#1626) @dependabot-preview
    • โฌ†๏ธ Bump cucumber-java from 4.5.1 to 4.5.4 in /examples (#1615) @dependabot-preview
    • โฌ†๏ธ Bump cucumber-junit from 4.5.1 to 4.5.4 in /examples (#1614) @dependabot-preview
    • โฌ†๏ธ Bump tomcat-jdbc from 9.0.21 to 9.0.22 in /modules/mysql (#1599) @dependabot-preview
    • โฌ†๏ธ Bump tomcat-jdbc from 9.0.21 to 9.0.22 in /modules/mariadb (#1600) @dependabot-preview