# Understanding why (kaocha.repl/run 'my.ns-test) doesn't run my tests

**URL:** https://clojureverse.org/t/understanding-why-kaocha-repl-run-my-ns-test-doesnt-run-my-tests/14818
**Category:** Kaocha
**Created:** [January 6, 2026, 2:26pm UTC](https://clojureverse.org/t/understanding-why-kaocha-repl-run-my-ns-test-doesnt-run-my-tests/14818 "2026-01-06T14:26:07Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![teodorlu](https://clojureverse.org/user_avatar/clojureverse.org/teodorlu/32/2896_2.png) [@teodorlu](https://clojureverse.org/u/teodorlu)
#### Post date: [January 6, 2026, 2:26pm UTC](https://clojureverse.org/t/understanding-why-kaocha-repl-run-my-ns-test-doesnt-run-my-tests/14818/1 "2026-01-06T14:26:07Z")

</div>

### Goal

I want to use `kaocha.repl` to run tests inside a library.

The REPL has been started from an application that uses the library with a `:local/root` dependency.

### `kaocha.repl/run` not running what I expect

I was surprised that Kaocha didn’t run my namespace. The following happens in my REPL:

```clojure
(require 'kaocha.repl)
(deftest wtf (is false))
(-> *ns* str symbol)
;; => terra.assetwatch-test

(kaocha.repl/run 'terra.assetwatch-test {:kaocha/fail-fast? true})
;; => WARNING: Did not load a configuration file and using the defaults.
;; This is fine for experimenting, but for long-term use, we recommend creating a configuration file to avoid changes in behavior between releases.
;; To create a configuration file using the current defaults and configuration file location, create a file named tests.edn that contains '#kaocha/v1 {}'.
;; WARNING: All 22 tests were skipped. Check for misspelled settings in your Kaocha test configuration or incorrect focus or skip filters.
;; WARNING: Test run exited with code 0
;; 0

```

## Context

I jacked my REPL into an application, which uses a library with a `:local/root` dependency. This in my current working directory _not_ being a root folder for the file I’m evaluating code in.

```clojure
(require 'babashka.fs)

(str (babashka.fs/cwd))
;; => "/Users/teodorlu/repo/teodorlu/play.teod.eu"

*file*
;; => "/Users/teodorlu/repo/teodorlu/terra/test/terra/assetwatch_test.clj"

```

```clojure
(kaocha.repl/config)
;; => e[33mWARNING: e[mDid not load a configuration file and using the defaults.
;; This is fine for experimenting, but for long-term use, we recommend creating a configuration file to avoid changes in behavior between releases.
;; To create a configuration file using the current defaults and configuration file location, create a file named tests.edn that contains '#kaocha/v1 {}'.
;; {:kaocha.plugin.randomize/seed 2085742826,
;; :kaocha.plugin.randomize/randomize? true,
;; :kaocha/reporter [kaocha.report/dots],
;; :kaocha/color? true,
;; :kaocha/fail-fast? false,
;; :kaocha/plugins
;; [:kaocha.plugin/randomize
;; :kaocha.plugin/filter
;; :kaocha.plugin/capture-output],
;; :kaocha/tests
;; [{:kaocha.testable/type :kaocha.type/clojure.test,
;; :kaocha.testable/id :unit,
;; :kaocha/ns-patterns ["-test$"],
;; :kaocha/source-paths ["src"],
;; :kaocha/test-paths ["test"],
;; :kaocha.filter/skip-meta [:kaocha/skip]}],
;; :kaocha.plugin.capture-output/capture-output? true}

```

`(kaocha.repl/test-plan)` produces a test-plan that does _not_ reference terra.assetwatch-test. It’s big, so I’ll refrain from inlining it here.

* * *

I really just want the tests to run, I’m happy to call a different Kaocha API function if I’m calling the wrong function.

Any advice appreciated! Let me know if a minimal reproduction is desired.

---

<div class="post-metadata">

### Author: ![teodorlu](https://clojureverse.org/user_avatar/clojureverse.org/teodorlu/32/2896_2.png) [@teodorlu](https://clojureverse.org/u/teodorlu)
#### Post date: [January 6, 2026, 2:58pm UTC](https://clojureverse.org/t/understanding-why-kaocha-repl-run-my-ns-test-doesnt-run-my-tests/14818/2 "2026-01-06T14:58:44Z")

</div>

The tests are running if I add the library’s test folder to the application’s tests.edn:

```clojure
;; /Users/teodorlu/repo/teodorlu/play.teod.eu/tests.edn
#kaocha/v1
{:tests
 [{:id :tplay
   :test-paths ["test"]}
  {:id :terra
   :test-paths ["../../teodorlu/terra/test"]}]}

```

It appears kaocha.repl/run calls into general machinery that requires a test plan, and that test plan requires explicit test paths. I was hoping that since I provided an explicit namespace that’s already been loaded, It wouldn’t require a test plan!

---

<div class="post-metadata">

### Author: ![plexus](https://clojureverse.org/user_avatar/clojureverse.org/plexus/32/6_2.png) [@plexus](https://clojureverse.org/u/plexus)
#### Post date: [January 6, 2026, 4:46pm UTC](https://clojureverse.org/t/understanding-why-kaocha-repl-run-my-ns-test-doesnt-run-my-tests/14818/3 "2026-01-06T16:46:31Z")

</div>

Unfortunately it does. From kaocha’s POV that “namespace” is just the identifier of a test, which it uses to filter the tests in the test-plan. That way the machinery is generic, for other test types “namespace” might not even be a useful concept.
