From 94bac9704b2955faadeb71a58ce783bf398751aa Mon Sep 17 00:00:00 2001 From: Nick Alexander Date: Fri, 2 Sep 2016 13:52:18 -0700 Subject: [PATCH] Pre: Use SQLite temp files in deftest-db. These temp files will almost certainly live in memory only, speeding our test suite evaluation significantly. Before this patch, in a warmed REPL environment I get: Testing datomish.db-test Ran 19 tests containing 97 assertions. 0 failures, 0 errors. "Elapsed time: 1408.720681 msecs" "Elapsed time: 1343.986464 msecs" "Elapsed time: 1338.660762 msecs" After this patch, in a warmed REPL environment I get: Testing datomish.db-test Ran 19 tests containing 97 assertions. 0 failures, 0 errors. "Elapsed time: 587.605168 msecs" "Elapsed time: 569.522333 msecs" "Elapsed time: 589.080282 msecs" --- src/datomish/test_macros.cljc | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/src/datomish/test_macros.cljc b/src/datomish/test_macros.cljc index bf50d1a4..f97eab4c 100644 --- a/src/datomish/test_macros.cljc +++ b/src/datomish/test_macros.cljc @@ -5,8 +5,7 @@ (ns datomish.test-macros #?(:cljs (:require-macros - [datomish.test-macros] - [datomish.node-tempfile-macros])) + [datomish.test-macros])) (:require [datomish.pair-chan])) @@ -44,16 +43,8 @@ (defmacro deftest-db [n conn-var & body] `(deftest-async ~n - (if-cljs - (datomish.node-tempfile-macros/with-tempfile [t# (datomish.node-tempfile/tempfile)] - (let [~conn-var (datomish.pair-chan/