Skip to content

Commit

Permalink
Clean up.
Browse files Browse the repository at this point in the history
  • Loading branch information
alysbrooks committed Jul 4, 2022
1 parent 3445607 commit c1615a4
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 34 deletions.
1 change: 0 additions & 1 deletion src/kaocha/result.clj
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
(defn ^:no-gen testable-totals
"Return a map of summed up results for a testable, including descendants."
[testable]
;; (prn "TESTABLE: " testable)
(if-let [testables (::tests testable)]
(merge testable (totals testables))
(merge (sum) testable)))
Expand Down
10 changes: 1 addition & 9 deletions src/kaocha/test_suite.clj
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,12 @@
(:require [clojure.test :as t]
[kaocha.testable :as testable]))



(defn run [testable test-plan]
(t/do-report {:type :begin-test-suite})
(let [results (testable/run-testables (:kaocha.test-plan/tests testable) test-plan)
;; _ (println "Done derefing")
;; __ (println (class results))
;; __ (println (class (last results)))
;; (doall (map #(if (future? %) (deref %) %)
;; (testable/run-testables (:kaocha.test-plan/tests testable) test-plan)))
testable (-> testable
(dissoc :kaocha.test-plan/tests)
(assoc :kaocha.result/tests results))]
(t/do-report {:type :end-test-suite
:kaocha/testable testable})
(doto testable tap>)
))
testable))
14 changes: 0 additions & 14 deletions src/kaocha/testable.clj
Original file line number Diff line number Diff line change
Expand Up @@ -243,20 +243,6 @@
(try-run-testable test test-plan (dec n))) ;otherwise retry
))

(defn f [acc value]
(if (instance? BlockingQueue value)
(.drainTo value acc)
(.put acc value))
acc)

(defn f [acc value] (doto acc (.put value)))

(def q (ArrayBlockingQueue. 1024))
(def r (ArrayBlockingQueue. 1024))

(.put r 5)

(reduce f [q 1 2 r])

(defn run-testables-serial
"Run a collection of testables, returning a result collection."
Expand Down
2 changes: 0 additions & 2 deletions src/kaocha/type/ns.clj
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
(defn run-tests [testable test-plan fixture-fn]
;; It's not guaranteed the the fixture-fn returns the result of calling the
;; tests function, so we need to put it in a box for reference.
;; (println (keys test-plan))
;; (println (:kaocha.testable/meta test-plan))
(let [result (atom (:kaocha.test-plan/tests testable))]
(fixture-fn #(swap! result testable/run-testables test-plan))
@result))
Expand Down
11 changes: 3 additions & 8 deletions test/unit/kaocha/type/ns_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,8 @@
:kaocha/ns-patterns ["-test$"]
:kaocha/source-paths ["src"]
:kaocha/test-paths ["fixtures/f-tests"]
:kaocha.filter/skip-meta [:kaocha/skip]})
:kaocha.filter/skip-meta [:kaocha/skip]})]

#_(testable/load {:kaocha.testable/type :kaocha.type/ns
:kaocha.testable/id :foo.bar-test
:kaocha.testable/desc "foo.bar-test"
:kaocha.ns/name 'foo.bar-test})]
(is (match? {:kaocha.testable/type :kaocha.type/ns
:kaocha.testable/id :foo.bar-test
:kaocha.ns/name 'foo.bar-test
Expand All @@ -103,6 +99,5 @@
(is (not (nil? (:result
(binding [testable/*config* (assoc testable/*config* :parallel true)]
(with-test-ctx {:fail-fast? true
:parallel true }
(testable/run testable testable)))))))
))
:parallel true}
(testable/run testable testable)))))))))

0 comments on commit c1615a4

Please sign in to comment.