I switch back and forth between clojure.test and kaocha when working at the repl. sometimes, if i first load the test suite with clojure and then try to run a given test file with kaocha later, it fails to load, throwing an error at testable/-load :kaocha.type/ns, saying
ERROR in all (load.clj:47)
Failed loading tests:
Exception: java.lang.NullPointerException: Cannot invoke "Object.hashCode()" because "key" is null
at java.util.concurrent.ConcurrentHashMap.get (ConcurrentHashMap.java:936)
clojure.lang.Namespace.find (Namespace.java:188)
clojure.core$find_ns.invokeStatic (core.clj:4131)
clojure.core$the_ns.invokeStatic (core.clj:4161)
clojure.core$ns_interns.invokeStatic (core.clj:4208)
clojure.core$ns_interns.invoke (core.clj:4208)
kaocha.type.ns$eval123123$fn__123124.invoke (ns.clj:37)
...
Not sure what's happening but this sounds fixable @nbtheduke . Any chance you can put together a minimal reproduction with steps?
Next time I run into it, I’ll see if I can get something together
possibly
okay, best as i can tell (having run into this a couple more times tho without any actionable info), this comes from pulling changes from another branch and then continuing to work without restarting my repl, and kaocha trying to load existing/new files that reference vars/namespaces that didn't exist when initially loaded
the issue seems to come from kaocha trying to load all of the test files instead of just the single file i'm testing
we have a custom hook that gathers test vars from all files in the test directory, maybe that's causing this?
is there a way to reset kaocha when it gets to this state without restarting the repl?
is there a way to skip loading the whole namespace every time?
Perhaps this? https://clojurians.slack.com/archives/CCY2V0U6A/p1690182082232329