From ff1215e7105795cf754042dd0c0c5c717abb201b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Z=C3=B6ller?= Date: Thu, 4 Mar 2021 15:43:37 +0100 Subject: [PATCH 1/3] Removed CircleCI badge --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index 8e67480..c3173cb 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,5 @@ # clj-test-containers -[![javahippie](https://circleci.com/gh/javahippie/clj-test-containers.svg?style=svg)]() - [![Clojars Project](http://clojars.org/clj-test-containers/latest-version.svg)](http://clojars.org/clj-test-containers) ## What it is From 12c4b6c1e9b429c3e4f72a6df7c24d2704bac538 Mon Sep 17 00:00:00 2001 From: Andrea Richiardi Date: Tue, 9 Mar 2021 00:26:47 -0800 Subject: [PATCH 2/3] [Fix #50] Add type hints for ResourceReaper (#51) --- src/clj_test_containers/core.clj | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/clj_test_containers/core.clj b/src/clj_test_containers/core.clj index 3a3b999..697599b 100644 --- a/src/clj_test_containers/core.clj +++ b/src/clj_test_containers/core.clj @@ -17,7 +17,8 @@ (org.testcontainers.images.builder ImageFromDockerfile) (org.testcontainers.utility - MountableFile))) + MountableFile + ResourceReaper))) (defn- resolve-bind-mode (^BindMode [bind-mode] @@ -27,7 +28,7 @@ (defn- reaper-instance [] - (org.testcontainers.utility.ResourceReaper/instance)) + (ResourceReaper/instance)) (defmulti wait "Sets a wait strategy to the container. Supports :http, :health and :log as @@ -278,10 +279,10 @@ [port] [port (.getMappedPort container port)]) mapped-ports (into {} (map map-port) exposed-ports) - container-id (.getContainerId container) - image-name (.getDockerImageName container) + container-id ^String (.getContainerId container) + image-name ^String (.getDockerImageName container) logger (log log-to container)] - (.registerContainerForCleanup (reaper-instance) + (.registerContainerForCleanup ^ResourceReaper (reaper-instance) container-id image-name) (-> container-config @@ -317,7 +318,7 @@ (let [network (.build builder) network-name (.getName network)] - (.registerNetworkIdForCleanup (reaper-instance) network-name) + (.registerNetworkIdForCleanup ^ResourceReaper (reaper-instance) network-name) {:network network :name network-name :ipv6 (.getEnableIpv6 network) @@ -328,7 +329,7 @@ (defn perform-cleanup! "Stops and removes all container instances which were created in the active JVM or REPL session" [] - (.performCleanup (reaper-instance))) + (.performCleanup ^ResourceReaper (reaper-instance))) ;;; REPL Helpers From b13499bc7cf1121906bcec8375ae1145313af95a Mon Sep 17 00:00:00 2001 From: Gilles Philippart Date: Tue, 1 Jun 2021 18:52:04 +0100 Subject: [PATCH 3/3] Fix unbalanced parens and braces (#52) --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index c3173cb..cb6eaee 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ The library provides a set of functions to interact with the testcontainers. A s (tc/bind-filesystem! {:host-path "/tmp" :container-path "/opt" :mode :read-only}) - (tc/start!)) + (tc/start!))) (do-database-testing (:host container) (get (:mapped-ports container) 5432)) @@ -39,7 +39,7 @@ If you'd rather create a container from a Dockerfile in your project, it could l (def container (-> (tc/create-from-docker-file {:env-vars {"FOO" "bar"} :exposed-ports [80] :docker-file "resources/Dockerfile"}) - (tc/start!)) + (tc/start!))) ``` If you prefer to use prebuilt containers from the Testcontainers project, you can do it like this @@ -50,7 +50,7 @@ If you prefer to use prebuilt containers from the Testcontainers project, you ca (def container (-> (tc/init {:container (PostgreSQLContainer. "postgres:12.2") :exposed-ports [5432]}) - (tc/start!)) + (tc/start!))) ``` ## Functions and Properties @@ -227,7 +227,7 @@ Starts the Testcontainer, which was defined by `create` ```clojure (def container (create {:image-name "alpine:3.2" :exposed-ports [80] - :env-vars {"MAGIC_NUMBER" "42"}) + :env-vars {"MAGIC_NUMBER" "42"}})) (start! container) ``` @@ -253,7 +253,7 @@ The `container-config` ```clojure (def container (create {:image-name "alpine:3.2" :exposed-ports [80] - :env-vars {"MAGIC_NUMBER" "42"}) + :env-vars {"MAGIC_NUMBER" "42"}})) (start! container) (stop! container) @@ -402,7 +402,7 @@ Creates a network. The optional map accepts config values for enabling ipv6 and ```clojure ;;Create with config (create-network {:ipv6 false - :driver "overlay") + :driver "overlay"}) ;;Create with default config (create-network)