lazytest

2026-05-18T15:57:20.737179Z

hey @seancorfield lazytest will load everything under test. if you want it to only load a specific file, i think you gotta do -d path/to/file.clj

2026-05-18T15:57:59.818579Z

i think changing -n to inform which namespaces are loaded is probably smart tho

2026-05-18T15:58:35.603519Z

(defn require-dirs [config dirs]
  (let [dirs (map io/file (or dirs #{"test"}))
        md-nses (add-md-tests config dirs)
        nses (into (find-ns-decls dirs)
                   md-nses)]
    (when (empty? nses)
      (throw (ex-info "No namespaces to run" {:dirs dirs})))
    (apply require nses)
    nses))

2026-05-18T15:58:47.966789Z

that's called unconditionally by -main

2026-05-18T16:01:34.312859Z

adding something like

nses (if-let [ns-filter (:ns-filter config)]
               (filterv ns-filter nses)
               nses)
would probably work just fine

2026-05-18T16:05:37.603429Z

hmm no that won't work because you can filter vars too

seancorfield 2026-05-18T16:10:44.531449Z

No worries. I hit a non-LazyTest issue now so this is probably pretty fruitless (I solved the loading issue with reader conditionals 😉 )

👍 1
2026-05-18T16:25:41.308329Z

i think this is a worthwhile change, so if you get a moment, wanna open a github issue with a small comment? i'm out with my family and don't wanna forget

seancorfield 2026-05-18T16:26:22.283459Z

I'm not sure what change you're suggesting here?

2026-05-18T17:10:33.484249Z

sorry, never mind. i'm on my computer sooner than anticipated

2026-05-18T17:13:32.839499Z

https://github.com/NoahTheDuke/lazytest/issues/35 is what i meant

seancorfield 2026-05-18T18:21:19.270519Z

Ah, so if you filter by ns, it would no longer even load the unwanted nses? That would be nice. And for Var filters, it would only load the nses mentioned in those Vars?

2026-05-18T18:43:58.849889Z

Right

2026-05-18T18:45:37.584339Z

looks like it's actually pretty easy to do, once i actually looked at the code proper. i think it's technically a breaking change (if you're doing naughty stuff like interning in namespaces, or globally referencing a defrecord class), but if you're doing that, stop being naughty?

2026-05-18T18:45:47.585349Z

just require/import the class/namespace as necessary

seancorfield 2026-05-18T18:45:53.316869Z

Yup, def.

2026-05-18T18:46:16.913139Z

thankfully, we're not using multimethods for assert-expr so we don't need to worry about those kinds of side-effects

🤣 1