0.2.4 - tests

This commit is contained in:
Michiel Borkent 2020-11-27 09:48:31 +01:00
parent fc11d6d0cb
commit 42e3f44fcb
2 changed files with 78 additions and 67 deletions

View file

@ -34,3 +34,6 @@ lein test :only babashka.classpath-test/classpath-env-test
export BABASHKA_POD_TEST=true
lein test :only babashka.pod-test
export BABASHKA_SOCKET_REPL_TEST=true
lein test :only babashka.impl.socket-repl-test

View file

@ -40,7 +40,10 @@
(def server-process (volatile! nil))
(def exec? (System/getenv "BABASHKA_SOCKET_REPL_TEST"))
(deftest socket-repl-test
(when exec?
(try
(if tu/jvm?
(let [ctx (init {:namespaces {'clojure.core.server clojure-core-server}
@ -65,10 +68,12 @@
(finally
(if tu/jvm?
(do (stop-repl!)
(vreset! common/ctx nil)
(Thread/sleep 100))
(p/destroy-tree @server-process)))))
(p/destroy-tree @server-process))))))
(deftest socket-repl-opts-test
(when exec?
(try
(if tu/jvm?
(let [ctx (init {:bindings {'*command-line-args*
@ -87,10 +92,12 @@
(finally
(if tu/jvm?
(do (stop-repl!)
(vreset! common/ctx nil)
(Thread/sleep 100))
(p/destroy-tree @server-process)))))
(p/destroy-tree @server-process))))))
(deftest socket-prepl-test
(when exec?
(try
(if tu/jvm?
(let [ctx (init {:bindings {'*command-line-args*
@ -113,8 +120,9 @@
(finally
(if tu/jvm?
(do (stop-repl!)
(vreset! common/ctx nil)
(Thread/sleep 100))
(p/destroy-tree @server-process)))))
(p/destroy-tree @server-process))))))
;;;; Scratch