kaocha

jyn 2026-06-09T09:16:00.414329Z

yoooo i found out how to fix kaocha's error reporting to be easy to read when there's a syntax error

ERROR in unit (file:/Users/jyn/src/clojure/paracress/test/flower/scripts_test.clj:35)
Failed reloading flower.scripts-test:
Exception: Syntax error reading source at (flower/scripts_test.clj:463:1).
  --> test/flower/scripts_test.clj:10:1
  10 | (load-file "scripts/spec_readability_review.clj"
       ^ form starts here
  note: EOF while reading, starting at line 10
1 tests, 1 assertions, 1 errors, 0 failures.

jyn 2026-06-09T09:17:31.386359Z

the trick is to add a (defmethod kaocha-report/fail-summary :error)

plexus 2026-06-09T11:07:01.722429Z

hi jyn 👋🏻 that sounds interesting, can you elaborate?

jyn 2026-06-09T11:17:08.419809Z

there's a little bit of docs here but not much https://cljdoc.org/d/lambdaisland/kaocha/1.91.1392/api/kaocha.report#fail-summary

jyn 2026-06-09T11:18:23.769389Z

this is my full code https://gist.github.com/jyn514/d92ba395b0375f8b2414a4191342f5a0

jyn 2026-06-09T11:19:06.887939Z

(note that this code is LLM generated in case that bothers you)

plexus 2026-06-09T13:12:35.710219Z

it's interesting as a PoC, would love to see a write-up of the current behaviour, and the problem's we're trying to solve. I like the general direction, kaocha definitely wants to provide good ergonomics, but there are trade-offs, and I don't currently have the full picture. For example, it seems you're not emitting a stack trace? that's pretty useful information

jyn 2026-06-09T13:13:44.574729Z

i don't have a stacktrace for compiler errors, under the assumption that you don't want to show compiler internals. i believe i have a stacktrace for everything else, if i don't that's a bug

jyn 2026-06-09T13:14:09.290469Z

i also have this configuration locally in tests.edn:

:bindings {kaocha.stacktrace/*stacktrace-stop-list* ["kaocha.runner" "kaocha.type" "kaocha.watch"]
            kaocha.stacktrace/*stacktrace-filters* ["" "clojure.lang" "sci.impl" "clojure.core.protocols" "clojure.tools.reader"]}}