Fork me on GitHub
Ferdinand Beyer07:04:39

Is my understanding right that the portal VS-Code extension always starts a server, and puts the server’s address in .portal/vs-code.edn? I’m asking because I’d like to check if this file exists to decide which :launcher to use (in user.clj) as not everyone in my team uses VS-Code.


Although, I don't delete the file when you close vs-code :thinking_face:

Ferdinand Beyer15:04:19

That’s fine for my use case I think. Thanks!

👍 1

I went ahead and the auto delete. I might add a {:launcher :auto} to resolve this issue automatically :thinking_face:

Ferdinand Beyer06:04:02

Sounds good 😎


Thanks again for the Intellij fixes @coyotesqrl! ❤️

👍 1
🎉 2

Neat. How does the clojure.test output stuff work?


i.e., what has to happen in the backend/test runner for Portal to show that?


So the viewer has a spec that matches data that get's sent to clojure.test/report :

[{:type :begin-test-ns, :ns}
 {:type :begin-test-var,
  :var #'}
 {:type :pass, :expected (= 0 0), :actual (= 0 0), :message nil}
 {:file "NO_SOURCE_FILE",
  :type :fail,
  :line 8,
  :expected (= 0 (inc 0)),
  :actual (not (= 0 1)),
  :message nil}
 {:type :end-test-var,
  :var #'}
 {:type :end-test-ns, :ns}]


So you still have to instrument your repl to output data like ☝️


I've been wrapping my evals with something like:

(with-redefs [clojure.test/report ...] ...code)
And then conditionally tapping if there is any test output


OK. And how scalable is that likely to be for a test run with many thousands of tests in it?


I haven't tried that many, so not sure yet


Should be no different that tapping many values to portal 👌


(and it probably won't play nice with any tooling that already overrides clojure.test/report such as Paul Stadig's Humane Test Output?)

👍 1

I might try to take it for a test run (haha -- see what I did there?) when I next restart my work REPL and it picks up the new Portal "RELEASE" 🙂

😆 1
bananadance 1

Also, I haven't tried this yet, but I think if you have a lot of tests, you could tap an atom that has test data appended to it over time


At some point I'll get around to releasing how I've instrumented portal into my REPL workflow 👌


Yeah, I really should do some more short videos... or perhaps live stream some OSS project work...

👀 1
💯 2