Skip to content

Commit

Permalink
Don't let the "no tests found" message shadow the load error
Browse files Browse the repository at this point in the history
When files fail to parse then it's likely no tests can be loaded, in that case
we need to show the error, not the generic "check your config" message.
  • Loading branch information
plexus committed Apr 29, 2021
1 parent 8f18bab commit 9df982c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion bb_deps.edn
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{:deps
{lambdaisland/open-source {:git/url "https://github.com/lambdaisland/open-source"
:sha "55f81454a62b0688a0702735257cc5473f2f0c60"
:sha "43ea822056ce84017639841ac082b9007a32d0f4"
#_#_:local/root "../open-source"}}}
4 changes: 3 additions & 1 deletion src/kaocha/api.clj
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,9 @@
(with-bindings (config/binding-map config)
(let [config (resolve-reporter config)]
(let [test-plan (test-plan config)]
(when-not (some hierarchy/leaf? (testable/test-seq test-plan))
(when-not (some #(or (hierarchy/leaf? %)
(::testable/load-error %))
(testable/test-seq test-plan))
(output/warn (str "No tests were found, make sure :test-paths and "
":ns-patterns are configured correctly in tests.edn."))
(throw+ {:kaocha/early-exit 0}))
Expand Down
6 changes: 2 additions & 4 deletions test/unit/kaocha/version_check_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,8 @@

(deftest current-version-does-not-throw
(is (nil? (binding [*clojure-version* {:major 1 :minor 9}]
(v/check-version-minimum 1 9)))))

(v/check-version-minimum 1 9)))))

(deftest version-2-does-not-throw
(is (nil? (binding [*clojure-version* {:major 2 :minor 0}]
(v/check-version-minimum 1 9)))))

(v/check-version-minimum 1 9)))))

0 comments on commit 9df982c

Please sign in to comment.