calva

seancorfield 2025-06-10T21:11:42.604429Z

I have a question about running tests: how exactly does VS Code/Calva hook into clojure.test from both a test running perspective and a test reporting perspective? Background: I'm migrating away from Expectations -- because of the underlying limitations of clojure.test -- and moving to LazyTest instead. It's "better" because it has separates test running and test reporting but that also means that how you run LazyTest and how you report the results is different. Right now, I use a custom REPL snippet to run both clojure.test and LazyTest tests, but it doesn't integrate into the built-in test running machinery in VS Code, and I'd like to see what's needed to make that work.

seancorfield 2025-06-10T21:12:53.042839Z

I think part of this is "how does VS Code/Calva recognize that something is a test?" in order to display the green "run" buttons in the gutter of the editor -- and what do those "run" buttons invoke?

seancorfield 2025-06-10T21:13:17.225979Z

And how does that report back to VS Code's test runner what passed and failed?

sashton 2025-06-11T14:14:00.343089Z

Here's the function which sends test results to the VSCode TestController: https://github.com/BetterThanTomorrow/calva/blob/1bdf1d8dcf84926efa5afc83d4436f0fca08f9d3/src/testRunner.ts#L82

seancorfield 2025-06-11T14:33:02.664909Z

Thanks. The "how do tests run" part seem to be to delegate to CIDER -- which only knows how to run clojure.test, and only knows how to report clojure.test. I'm having this conversation in #cursive as well and at least there it is relying on evaluating run-tests directly and hooking into its reporting mechanism so it doesn't depend on CIDER for run/report...

seancorfield 2025-06-11T14:33:52.000489Z

I suspect we might need some kind of monkey-patching to make things work with CIDER...