Hey folks! jank has gained an nREPL server, written in jank. 🕺 I'd like to get an idea about testing it, so I've been looking around for a standard test suite for nREPL servers. Does such a thing exist? If not, should it? I found a three year old discussion https://github.com/nrepl/nrepl/discussions/273, wherein @borkdude offered to spin such a thing up. Rather than necro-post there, I'm asking here; if you'd rather me post on that old Discussion, just let me know.
are there plans for a socket server?
What do you mean socket server, Dan? nREPL uses TCP sockets. 🙃
i mean like clojure offers:
❯ clj -J-Dclojure.server.repl="{:port 5999 :accept clojure.core.server/repl}"
Clojure 1.12.1
user=>
and then
❯ netcat localhost 5999
user=> (+ 1 1)
2Ah, gotcha. Not currently slated. My understanding is that nREPL is the de facto REPL protocol for Clojure, by community usage, so I'm aiming for best bang for buck here.
that’s certainly true. There is some magic to a repl that doesn’t require the main entrypoint though. Maybe in the future
Yep, there's no reason that lib can't be ported to jank. Even today, that's doable!
It doesn’t exist yet, but it’s the cards for this year.
The main problem was the we never agreed on the “official” nREPL spec, but there’s some finally some movement on that front - see https://github.com/nrepl/spec.nrepl.org/pull/1
But as jank is so similar to Clojure, I think for you it should be easier than average to fill in the gap in the meantime - you can just adapt the test suite of the Clojure nREPL implementation or something along those lines. Or perhaps directly test against a client like Calva or CIDER.
or just port babashka's nrepl server or look at its tests :)
Well, that’s also an option. Once we settle on the final nREPL spec I plan to write a simpler reference server for it as well, as it seems it’d be hard to get consensus on whether things like sessions are essential or only nice to have.
maybe a test client could also work that you can fire at every posssible dialect that has an nREPL server
Yeah, we’ll certainly need a spec-compliant reference client as well. But this is the easy part - agreeing on the spec will be a bit harder. 😄
Thanks for the follow up! I've been watching the spec develop with interest. 🙂
> or just port babashka's nrepl server or look at its tests 🙂 Following bb's tests to build my own jank suite can work, but it would not be my first course of action. Just as the community needs a clojure-test-suite, it also needs a MVP nREPL server test suite. I think a spec is a great way to make this even more viable.
Well, I can only hope more people will participate in the discussion and driving it forward. If @technomancy doesn't have time to wrap up the PR himself I'll just merge it at some point and we'll continue to iterate on it.