kaocha

2024-02-26T18:44:34.681769Z

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)
    ...

plexus 2024-02-28T09:29:33.950679Z

Not sure what's happening but this sounds fixable @nbtheduke . Any chance you can put together a minimal reproduction with steps?

2024-02-28T11:52:33.992139Z

Next time I run into it, I’ll see if I can get something together

plexus 2024-03-25T08:09:03.719989Z

possibly

2024-03-22T17:40:14.394829Z

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

2024-03-22T17:41:11.309709Z

the issue seems to come from kaocha trying to load all of the test files instead of just the single file i'm testing

2024-03-22T17:43:20.396239Z

we have a custom hook that gathers test vars from all files in the test directory, maybe that's causing this?

2024-02-26T18:45:08.802779Z

is there a way to reset kaocha when it gets to this state without restarting the repl?

2024-02-26T18:46:32.437529Z

is there a way to skip loading the whole namespace every time?

imre 2024-02-26T20:00:09.664209Z

Perhaps this? https://clojurians.slack.com/archives/CCY2V0U6A/p1690182082232329