Skip to content

Commit

Permalink
Simplify kaocha fail reporting
Browse files Browse the repository at this point in the history
  • Loading branch information
imrekoszo committed Mar 25, 2022
1 parent eb7d3be commit 3407843
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
(ns polylith.clj.core.kaocha-test-runner-example
(:require
[polylith.clj.core.test-runner-plugin.interface :as test-runner-plugin]
[polylith.clj.core.util.interface.color :as color]))
[polylith.clj.core.test-runner-plugin.interface :as test-runner-plugin]))

(defn rf-some
"Reducing function that returns the first logical true value.
Expand Down Expand Up @@ -70,7 +69,7 @@
(run-tests [this {:keys [color-mode eval-in-project is-verbose] :as opts}]
(when (test-runner-plugin/tests-present? this opts)
(let [config (->test-plan-config eval-in-project)
{:kaocha.result/keys [count pass error fail pending]}
{:kaocha.result/keys [error fail]}
(eval-in-project
`(do
(require 'kaocha.repl 'kaocha.api 'kaocha.result)
Expand All @@ -82,7 +81,6 @@
(kaocha.repl/config)
(kaocha.api/run)
(:kaocha.result/tests)
(kaocha.result/totals))))
result-str (str "Test results (total " count "): " pass " passes, " pending " pending, " fail " failures, " error " errors.")]
(when (or (< 0 error) (< 0 fail))
(throw (Exception. (str "\n" (color/error color-mode result-str)))))))))))
(kaocha.result/totals))))]
(when (or (some nil? [error fail]) (< 0 error) (< 0 fail))
(throw (Exception. "\nTests failed.")))))))))
1 change: 0 additions & 1 deletion projects/kaocha-test-runner-example/deps.edn
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

{:deps {poly/kaocha-test-runner-example {:local/root "../../bases/kaocha-test-runner-example"}
poly/test-runner-plugin {:local/root "../../components/test-runner-plugin"}
poly/util {:local/root "../../components/util"}

org.clojure/clojure {:mvn/version "1.10.3"}}

Expand Down

0 comments on commit 3407843

Please sign in to comment.