Fork me on GitHub
#portal
<
2022-04-22
>
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.

djblue15:04:00

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
djblue17:04:42

I went ahead and https://github.com/djblue/portal/commit/09db810db9c5fc4ce53f1a89573089ac598c526f the auto delete. I might add a {:launcher :auto} to resolve this issue automatically :thinking_face:

Ferdinand Beyer06:04:02

Sounds good 😎

djblue19:04:45

Thanks again for the Intellij fixes @coyotesqrl! ❤️

👍 1
🎉 2
seancorfield19:04:12

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

seancorfield19:04:48

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

djblue19:04:17

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

[{:type :begin-test-ns, :ns examples.data}
 {:type :begin-test-var,
  :var #'examples.data/test-report}
 {: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 #'examples.data/test-report}
 {:type :end-test-ns, :ns examples.data}]

djblue19:04:33

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

djblue19:04:00

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

seancorfield19:04:13

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

djblue19:04:38

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

djblue19:04:49

Should be no different that tapping many values to portal 👌

seancorfield19:04:08

(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
seancorfield19:04:00

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
djblue19:04:14

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

djblue19:04:32

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

seancorfield19:04:05

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

👀 1
💯 2