TestContainers v1.12.1 Release Notes

Release Date: 2019-09-08 // 16 days ago
  • What's Changed

    ๐Ÿฑ ๐Ÿš€ Features

    • โœ… Use "copy" strategy in withClasspathResourceMapping where appropriate (#1814) @bsideup
    • โœ… Speed up listening port detection by running the checks as a single command (#1782) @bsideup
    • ๐Ÿ”ง RabbitMQ: Support legacy RabbitMQ configuration format (#1692) @twillouer
    • โœ… Separate "environment" and "classpath" properties (for global things) (#1784) @bsideup
    • โž• Add check for compatible Docker OS type, to fail gracefully if Docker daemon does not support Linux containers (#1780) @casz

    ๐Ÿฑ ๐Ÿ› Bug Fixes

    • ๐Ÿ›  Fix credentials when using a helper that returns a token (#1734) @rszewczyk
    • โœ… Reinstate retries for image pulls (#1712) @rnorth
    • โœ… Amend container shutdown to catch and log for all Exception classes (#1663) @rnorth
    • โœ… Coordinate image removals after stopping containers (#1745) @aguibert
    • โœ… RabbitMQ: fix typo in binding command (#1792) @glefloch
    • ๐Ÿ›  Fix Deprecated MySQL Class Name warnings (#1760) @turackangal
    • โœ… Exclude jna transitive dependency from visible-assertions to reconcile versions (#1744) @eggilbert

    ๐Ÿ“š ๐Ÿ“– Documentation

    ๐Ÿงน Housekeeping

    Click to expand... โœ… Add test to demonstrate fix for #1452 (loss of whitespace in spโ€ฆ (#1702) @rnorth โœ… Add more labels to the Stale bot's config (#1810) @bsideup โœ… Disable Travis for all but master branch builds (#1720) @rnorth โœ… Add docker-compose.yml to simplify local doc development (#1653) @mikesir87 โœ… Add Maven Central as a fallback for dependency download (#1710) @rnorth โœ… Fix fixed host port test (#1355) @glebsts โœ… Mark toxiproxy tests as flaky pending further analysis (#1772) @rnorth โœ… JUnit rule for flaky test retry (#1680) @rnorth

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

    Click to expand... ๐Ÿš€ Bump org.springframework.boot from 2.1.7.RELEASE to 2.1.8.RELEASE in /examples (#1831) @dependabot-preview โœ… Bump aws-java-sdk-sqs from 1.11.625 to 1.11.626 in /modules/localstack (#1830) @dependabot-preview โœ… Bump aws-java-sdk-sqs from 1.11.624 to 1.11.625 in /modules/localstack (#1829) @dependabot-preview โœ… Bump pulsar-client from 2.4.0 to 2.4.1 in /modules/pulsar (#1825) @dependabot-preview โœ… Bump aws-java-sdk-sqs from 1.11.623 to 1.11.624 in /modules/localstack (#1826) @dependabot-preview โœ… Bump neo4j from 3.5.8 to 3.5.9 in /modules/neo4j (#1823) @dependabot-preview โœ… Bump amqp-client from 5.7.2 to 5.7.3 in /core (#1818) @dependabot-preview โœ… Bump aws-java-sdk-sqs from 1.11.622 to 1.11.623 in /modules/localstack (#1819) @dependabot-preview โœ… Bump slf4j-api from 1.7.26 to 1.7.28 in /core (#1805) @dependabot-preview โœ… Bump rest-assured from 4.0.0 to 4.1.0 in /modules/vault (#1820) @dependabot-preview โœ… Bump commons-compress from 1.18 to 1.19 in /core (#1804) @dependabot-preview โœ… Bump cucumber-java from 4.7.1 to 4.7.2 in /examples (#1812) @dependabot-preview โœ… Bump aws-java-sdk-sqs from 1.11.621 to 1.11.622 in /modules/localstack (#1811) @dependabot-preview โœ… Bump cucumber-junit from 4.7.1 to 4.7.2 in /examples (#1809) @dependabot-preview โœ… Bump aws-java-sdk-sqs from 1.11.620 to 1.11.621 in /modules/localstack (#1808) @dependabot-preview โœ… Bump aws-java-sdk-sqs from 1.11.619 to 1.11.620 in /modules/localstack (#1803) @dependabot-preview โœ… Bump mongo-java-driver from 3.10.2 to 3.11.0 in /core (#1795) @dependabot-preview โœ… Bump aws-java-sdk-sqs from 1.11.618 to 1.11.619 in /modules/localstack (#1793) @dependabot-preview โœ… Bump mockito-core from 2.28.2 to 3.0.0 in /modules/junit-jupiter (#1636) @dependabot-preview โœ… Bump jedis from 3.0.1 to 3.1.0 in /core (#1656) @dependabot-preview โœ… Bump snakeyaml from 1.21 to 1.25 in /core (#1742) @dependabot-preview โœ… Bump assertj-core from 3.12.2 to 3.13.2 in /core (#1789) @dependabot-preview โœ… Bump selenium-firefox-driver from 3.14.0 to 3.141.59 in /examples (#1748) @dependabot-preview โœ… Bump aws-java-sdk-sqs from 1.11.616 to 1.11.618 in /modules/localstack (#1785) @dependabot-preview โœ… Bump mockito-core from 2.28.2 to 3.0.0 in /core (#1635) @dependabot-preview โœ… Bump elasticsearch-rest-client from 6.7.1 to 7.3.1 in /modules/elasticsearch (#1779) @dependabot-preview โœ… Bump aws-java-sdk-sqs from 1.11.615 to 1.11.616 in /modules/localstack (#1768) @dependabot-preview โœ… Bump aws-java-sdk-sqs from 1.11.613 to 1.11.615 in /modules/localstack (#1762) @dependabot-preview โœ… Bump tomcat-jdbc from 9.0.22 to 9.0.24 in /modules/mysql (#1755) @dependabot-preview โœ… Bump aws-java-sdk-sqs from 1.11.612 to 1.11.613 in /modules/localstack (#1754) @dependabot-preview โœ… Bump tomcat-jdbc from 9.0.22 to 9.0.24 in /modules/mariadb (#1753) @dependabot-preview โœ… Bump aws-java-sdk-sqs from 1.11.611 to 1.11.612 in /modules/localstack (#1750) @dependabot-preview โœ… Bump aws-java-sdk-sqs from 1.11.610 to 1.11.611 in /modules/localstack (#1747) @dependabot-preview ๐Ÿš€ Bump org.springframework.boot from 2.1.6.RELEASE to 2.1.7.RELEASE in /examples (#1736) @dependabot-preview โœ… Bump java-client from 2.7.7 to 2.7.9 in /modules/couchbase (#1714) @dependabot-preview ๐Ÿš€ Bump lettuce-core from 5.1.7.RELEASE to 5.1.8.RELEASE in /examples (#1696) @dependabot-preview โœ… Bump aws-java-sdk-sqs from 1.11.609 to 1.11.610 in /modules/localstack (#1741) @dependabot-preview โœ… Bump aws-java-sdk-sqs from 1.11.608 to 1.11.609 in /modules/localstack (#1735) @dependabot-preview โœ… Bump assertj-core from 3.13.1 to 3.13.2 in /modules/kafka (#1707) @dependabot-preview โœ… Bump mariadb-java-client from 2.4.2 to 2.4.3 in /modules/mariadb (#1704) @dependabot-preview โœ… Bump slf4j-api from 1.7.26 to 1.7.28 in /examples (#1730) @dependabot-preview โœ… Bump pulsar-client from 2.3.2 to 2.4.0 in /modules/pulsar (#1729) @dependabot-preview โœ… Bump assertj-core from 3.13.1 to 3.13.2 in /modules/neo4j (#1708) @dependabot-preview โœ… Bump assertj-core from 3.13.1 to 3.13.2 in /modules/database-commons (#1705) @dependabot-preview โœ… Bump aws-java-sdk-sqs from 1.11.604 to 1.11.608 in /modules/localstack (#1728) @dependabot-preview โœ… Bump assertj-core from 3.13.1 to 3.13.2 in /modules/pulsar (#1703) @dependabot-preview โœ… Bump aws-java-sdk-sqs from 1.11.601 to 1.11.604 in /modules/localstack (#1709) @dependabot-preview โœ… Bump jedis from 3.0.1 to 3.1.0 in /examples (#1686) @dependabot-preview โœ… Bump assertj-core from 3.12.2 to 3.13.1 in /modules/database-commons (#1685) @dependabot-preview โœ… Bump jedis from 3.0.1 to 3.1.0 in /modules/junit-jupiter (#1657) @dependabot-preview โœ… Bump assertj-core from 3.12.2 to 3.13.1 in /modules/pulsar (#1684) @dependabot-preview โœ… Bump cucumber-junit from 4.6.0 to 4.7.1 in /examples (#1676) @dependabot-preview โœ… Bump assertj-core from 3.12.2 to 3.13.1 in /modules/neo4j (#1681) @dependabot-preview โœ… Bump aws-java-sdk-sqs from 1.11.599 to 1.11.601 in /modules/localstack (#1682) @dependabot-preview โœ… Bump assertj-core from 3.12.2 to 3.13.1 in /modules/kafka (#1683) @dependabot-preview โœ… Bump mysql-connector-java from 8.0.16 to 8.0.17 in /modules/junit-jupiter (#1658) @dependabot-preview โœ… Bump mysql-connector-java from 8.0.16 to 8.0.17 in /modules/spock (#1634) @dependabot-preview โœ… Bump cucumber-java from 4.6.0 to 4.7.1 in /examples (#1677) @dependabot-preview โœ… Bump aws-java-sdk-sqs from 1.11.598 to 1.11.599 in /modules/localstack (#1667) @dependabot-preview โœ… Bump aws-java-sdk-sqs from 1.11.597 to 1.11.598 in /modules/localstack (#1664) @dependabot-preview


Previous changes from v1.12.0

  • 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