Skip to content

Commit 22cf0d8

Browse files
committed
Add some debugging code for now.
1 parent 4a5b1b6 commit 22cf0d8

File tree

2 files changed

+20
-9
lines changed

2 files changed

+20
-9
lines changed

src/kaocha/testable.clj

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,12 @@
5959
(assert-spec :kaocha/testable testable)
6060
(let [type (::type testable)]
6161
(try-load-third-party-lib type)
62-
(assert-spec type testable)))
62+
(try
63+
(assert-spec type testable)
64+
(catch Exception e
65+
(prn e)
66+
)
67+
)))
6368

6469
(defmulti -load
6570
"Given a testable, load the specified tests, producing a test-plan."
@@ -125,8 +130,10 @@
125130
Also performs validation, and lazy loading of the testable type's
126131
implementation."
127132
[testable test-plan]
128-
(load-type+validate testable)
133+
;; (println (class testable))
129134
(binding [*current-testable* testable]
135+
;; (println (:kaocha.testable/id *current-testable*))
136+
(load-type+validate testable)
130137
(let [run (plugin/run-hook :kaocha.hooks/wrap-run -run test-plan)
131138
result (run testable test-plan)]
132139
(if-let [history history/*history*]
@@ -232,7 +239,8 @@
232239
(defn run-testables
233240
"Run a collection of testables, returning a result collection."
234241
[testables test-plan]
235-
(print "run-testables got a collection of size" (count testables)
242+
(doall testables)
243+
#_(print "run-testables got a collection of size" (count testables)
236244
" the first of which is "
237245
(:kaocha.testable/type (first testables))
238246
)
@@ -253,16 +261,21 @@
253261
(defn run-testables-parallel
254262
"Run a collection of testables, returning a result collection."
255263
[testables test-plan]
256-
257-
(print "run-testables-parallel got a collection of size" (count testables))
264+
(doall testables)
265+
;; (print "run-testables-parallel got a collection of size" (count testables))
258266
(let [load-error? (some ::load-error testables)
259267
;; results (watch/make-queue)
260268
;; put-return (fn [acc value]
261269
;; (if (instance? BlockingQueue value)
262270
;; (.drainTo value acc)
263271
;; (.put acc value))
264272
;; acc)
265-
futures (doall (map #(future (do (println "Firing off future!" (Thread/currentThread)) (binding [*config* (dissoc *config* :parallel)] (run-testable % test-plan)))) testables))]
273+
futures (doall (map #(do
274+
(println (:parallel *config*) \space (.getName (Thread/currentThread)))
275+
(future
276+
;(do #_(println "Firing off future!" (Thread/currentThread)) )
277+
(binding [*config* (dissoc *config* :parallel)] (run-testable % test-plan))))
278+
testables))]
266279
(comment (loop [result [] ;(ArrayBlockingQueue. 1024)
267280
[test & testables] testables]
268281
(if test

test/unit/kaocha/type/ns_test.clj

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,7 @@
6868
(with-test-ctx {:fail-fast? true}
6969
(testable/run testable testable)))))))
7070

71-
(require '[kaocha.config :as config])
72-
73-
(deftest run-test-parallel ;both tests currently test the parallel version but later...
71+
(deftest run-test-parallel
7472
(classpath/add-classpath "fixtures/f-tests")
7573

7674
(let [testable (testable/load {:kaocha.testable/type :kaocha.type/clojure.test

0 commit comments

Comments
 (0)