Prepare Release 0.3.0

This commit is contained in:
Tim Zöller 2020-10-23 23:12:24 +02:00
parent 94975f68f0
commit 193482c1b8
4 changed files with 120 additions and 110 deletions

View file

@ -1,10 +1,19 @@
# Change Log # Change Log
All notable changes to this project will be documented in this file. This change log follows the conventions of [keepachangelog.com](http://keepachangelog.com/). All notable changes to this project will be documented in this file. This change log follows the conventions of [keepachangelog.com](http://keepachangelog.com/).
## [0.3.0] - Upcoming ## [0.4.0] - Upcoming
## [0.3.0] - 2020-10-23
### Added ### Added
- [#25](https://github.com/javahippie/clj-test-containers/issues/25): Add support for a container wait stategy - [#25](https://github.com/javahippie/clj-test-containers/issues/25): Add support for a container wait stategy
- [#35](https://github.com/javahippie/clj-test-containers/issues/35): Add support for docker version 2.4.0 - upgrading testcontainers-java version - [#35](https://github.com/javahippie/clj-test-containers/issues/35): Add support for docker version 2.4.0 - upgrading testcontainers-java version
- [#27](https://github.com/javahippie/clj-test-containers/issues/27): Add support for accessing container logs
- [#38](https://github.com/javahippie/clj-test-containers/pull/38): Add type hints to silence reflection warnings
- [#33](https://github.com/javahippie/clj-test-containers/pull/33): Add more options to the HTTP wait strategy
- [#28](https://github.com/javahippie/clj-test-containers/pull/28): Link to the java lib
- [#23](https://github.com/javahippie/clj-test-containers/pull/23): Configure clojure.spec, spec out a few functions
- [#24](https://github.com/javahippie/clj-test-containers/pull/24): cljstyle redux, with pre-commit hook
- [#21](https://github.com/javahippie/clj-test-containers/pull/21): Install and configure cljstyle
### Changed ### Changed
- [#29](https://github.com/javahippie/clj-test-containers/issues/29): init-network should be called create-network! - [#29](https://github.com/javahippie/clj-test-containers/issues/29): init-network should be called create-network!

View file

@ -71,6 +71,7 @@ Creates a testcontainers instance from a given Docker label and returns them
| `:network` | Map | A map containing the configuration of a Docker Network (see: `create-network`) | | `:network` | Map | A map containing the configuration of a Docker Network (see: `create-network`) |
| `:network-aliases` | Map | A list of alias names for the container on the network | | `:network-aliases` | Map | A list of alias names for the container on the network |
| `:wait-for` | Map | A map containing the wait strategy to use and the condition to check for | | `:wait-for` | Map | A map containing the wait strategy to use and the condition to check for |
| `:log-to` | Map | A map containing the log strategy to use, e.g. {:log-strategy string} |
#### Result: #### Result:
@ -81,7 +82,7 @@ Creates a testcontainers instance from a given Docker label and returns them
| `:env-vars` | Map | Value of the same input parameter | | `:env-vars` | Map | Value of the same input parameter |
| `:host` | String | The host for the Docker Container | | `:host` | String | The host for the Docker Container |
| `:network` | Map | The network configuration of the Container, if provided | | `:network` | Map | The network configuration of the Container, if provided |
| `:wait-for` | Map | The wait-for configuration of the Container, if provided! | `:wait-for` | Map | The wait-for configuration of the Container, if provided! |
#### Example: #### Example:
@ -124,6 +125,8 @@ Initializes a given Testcontainer, which was e.g. provided by a library
| `:network` | Map | A map containing the configuration of a Docker Network (see: `create-network`) | | `:network` | Map | A map containing the configuration of a Docker Network (see: `create-network`) |
| `:network-aliases` | Map | A list of alias names for the container on the network | | `:network-aliases` | Map | A list of alias names for the container on the network |
| `:wait-for` | Map | A map containing the wait strategy to use and the condition to check for | | `:wait-for` | Map | A map containing the wait strategy to use and the condition to check for |
| `:log-to` | Map | A map containing the log strategy to use, e.g. {:log-strategy string} |
| | | |
#### Result: #### Result:
| Key | Type | Description | | Key | Type | Description |
@ -133,7 +136,7 @@ Initializes a given Testcontainer, which was e.g. provided by a library
| `:env-vars` | Map | Value of the same input parameter | | `:env-vars` | Map | Value of the same input parameter |
| `:host` | String | The host for the Docker Container | | `:host` | String | The host for the Docker Container |
| `:network` | Map | The network configuration of the Container, if provided | | `:network` | Map | The network configuration of the Container, if provided |
| `:wait-for` | Map | The wait-for configuration of the Container, if provided! | `:wait-for` | Map | The wait-for configuration of the Container, if provided! |
#### Example: #### Example:
@ -174,6 +177,8 @@ Creates a testcontainer from a Dockerfile
| `:network` | Map | A map containing the configuration of a Docker Network (see: `create-network`) | | `:network` | Map | A map containing the configuration of a Docker Network (see: `create-network`) |
| `:network-aliases` | Map | A list of alias names for the container on the network | | `:network-aliases` | Map | A list of alias names for the container on the network |
| `:wait-for` | Map | A map containing the wait strategy to use and the condition to check for | | `:wait-for` | Map | A map containing the wait strategy to use and the condition to check for |
| `:log-to` | Map | A map containing the log strategy to use, e.g. {:log-strategy string} |
| | | |
#### Result: #### Result:
| Key | Type | Description | | Key | Type | Description |
@ -183,7 +188,7 @@ Creates a testcontainer from a Dockerfile
| `:env-vars` | Map | Value of the same input parameter | | `:env-vars` | Map | Value of the same input parameter |
| `:host` | String | The host for the Docker Container | | `:host` | String | The host for the Docker Container |
| `:network` | Map | The network configuration of the Container, if provided | | `:network` | Map | The network configuration of the Container, if provided |
| `:wait-for` | Map | The wait-for configuration of the Container, if provided! | `:wait-for` | Map | The wait-for configuration of the Container, if provided! |
#### Example: #### Example:
@ -207,6 +212,7 @@ Starts the Testcontainer, which was defined by `create`
| ------------- | :------------- | :----- | | ------------- | :------------- | :----- |
| First parameter: | | | | First parameter: | | |
| `container-config` | Map, mandatory | Return value of the `create` function | | `container-config` | Map, mandatory | Return value of the `create` function |
| | | |
#### Result: #### Result:
| Key | Type | Description | | Key | Type | Description |
@ -381,7 +387,7 @@ Creates a network. The optional map accepts config values for enabling ipv6 and
| Key | Type | Description | | Key | Type | Description |
| ------------- | :------------- | :----- | | ------------- | :------------- | :----- |
| `:ipv6` | boolean | Should the network enable IPv6? | | `:ipv6` | boolean | Should the network enable IPv6? |
| `:driver`| String | The network driver used by Docker, e.g. `bridge` or `host` | `:driver` | String | The network driver used by Docker, e.g. `bridge` or `host` |
@ -404,9 +410,13 @@ Creates a network. The optional map accepts config values for enabling ipv6 and
(create-network) (create-network)
``` ```
### dump-logs
Call on a started container.
Provided logging was enabled for a container, returns the given log presentation, e.g. as a string
| Key | Type | Description |
| `container-config` | Map, mandatory | The configuration describing the container for which the log should be retrieved |
## License ## License
Copyright © 2020 Tim Zöller
Distributed under the Eclipse Public License either version 1.0 or (at Distributed under the Eclipse Public License either version 1.0 or (at
your option) any later version. your option) any later version.

View file

@ -1,4 +1,4 @@
(defproject clj-test-containers "0.3.0-SNAPSHOT" (defproject clj-test-containers "0.3.0"
:description "A lightweight, unofficial wrapper around the Testcontainers Java library" :description "A lightweight, unofficial wrapper around the Testcontainers Java library"
:url "https://github.com/javahippie/clj-test-containers" :url "https://github.com/javahippie/clj-test-containers"

View file

@ -27,15 +27,6 @@
(Thread/sleep 500) (Thread/sleep 500)
(is (includes? (sut/dump-logs initialized-container) "database system is ready to accept connections")))) (is (includes? (sut/dump-logs initialized-container) "database system is ready to accept connections"))))
(comment
(def cnt (sut/create {:image-name "postgres:12.2"
:exposed-ports [5432]
:env-vars {"POSTGRES_PASSWORD" "pw"}
:wait-for {:wait-strategy :log :message "accept connections"}
:log-to {:log-strategy :string}}))
(def cnt (sut/start! cnt))
(sut/dump-logs cnt))
(testing "Testing basic testcontainer generic image initialisation with wait for log message" (testing "Testing basic testcontainer generic image initialisation with wait for log message"
(let [container (sut/create {:image-name "postgres:12.2" (let [container (sut/create {:image-name "postgres:12.2"
:exposed-ports [5432] :exposed-ports [5432]