Fork me on GitHub
#lambdaisland
<
2020-06-24
>
plexus10:06:38

@kenny integrating with kaocha is the long term goal, yes, mainly because that way you'll get a command line interface. There's no ready made solution for that yet.

kenny13:06:46

So Chui is only meant to be used during development, not on CI?

plexus14:06:31

Chui does not currently offer an out of the box solution for headless operation, no.

kenny14:06:21

Got it. So the way you'd use Chui would be to run it while working on your cljs and to use shadow-cljs to run the tests on the CI? The primary advantage it gives you is a UI for viewing your cljs tests?

plexus14:06:57

With what is currently there, yes. Chui-ui is meant for interactive use in combination with shadow's reloading. There are several pieces to Chui, and only Chui-ui is tied to the browser. Chui is designed to form the base line for clojurescript test running, including from the CLI and on CI, but that is still WIP.

kenny14:06:11

I see. When I read "test runner" I thought that meant something invoked on the command line.

plexus15:06:17

it means something that runs your tests. There's the test library/framework that allows you to write your tests, and there's the test runner which finds the tests and runs them (possibly filtered, specific reporting, etc.)

kenny16:06:07

Sure. I suppose that a runner that can only run tests via UI fits that definition haha. I've just always thought of the "base" form of a runner as the ability to run tests via cli. UIs are nice-to-haves on top of the CLI. I now see the misunderstanding. Thanks for the clarification 🙂

plexus10:06:06

@dominicm I'll share an example client when I'm back at the computer

dominicm10:06:41

Cool. Have you hand rolled them all to date?

plexus10:06:34

yeah, basically. I have some code I've been copying from project to project. All you need is a websocket and transit. The websocket namespace I've largely lifted from Figwheel (on the clojurescript side). On Clojure I use Java-WebSocket.

plexus10:06:11

I had this sitting on my hard drive already but hadn't pushed it yet.

plexus10:06:33

haven't gotten around to making a reusable generic Clojure client yet...

plexus10:06:21

I'll probably add a clj client to funnel-client by the end of the month, before I do my monthly open source update post 🙂

dominicm10:06:35

Great, that's wonderful. I'll have a play.

dominicm10:06:08

I'm going to use it to see if I can create an enhanced cljs dev experience for editors. It's always tricky trying to do things like interpret the types once you're back at the editor or JVM, so pushing that into cljs makes sense.

plexus11:06:14

cool! looking forward to see what you come up with.

Casey12:06:24

I'm playing around with glogi, trying to figure out how to make it log my params as a string rather than a map... is this not what :closure-defines {lambdaisland.glogi.console.colorize "false"} should do?

plexus12:06:07

can you elaborate @ramblurr what your log statement looks like and what you want that to look like in your logs?

Casey12:06:46

(log/info "The current value is " 2)

;; prints: [my.ns] {"The current value is " 2, :line 10}
Whereas I'd like to not print structured logs, but just plain strings:
[my.ns] The current value is 2

plexus12:06:28

what would that look like in the logs?

plexus12:06:44

then you don't want to use Glögi

Casey12:06:05

(sorry the slack editor was giving me problems)

plexus12:06:46

no worries, so to elaborate, Glögi does structured logging, that's what it's designed for. Doing plaintext/printf style formatting is out of its scope

Casey12:06:59

fair enough!

plexus12:06:47

I would look into using the goog.log stuff directly, it's not that hard

plexus12:06:37

or you can still leverage some of the glögi helpers, like lambdaisland.glogi/set-levels and glogi/logger

plexus12:06:20

or adopt structured logging of course 🙂 I can only recommend it

Casey12:06:42

I use structured logging most places, however in this case I need something that needs to only be read by humans.. its more of a status log than a real log file

Casey12:06:02

I'm having some trouble outputing the evaled forms of the keyvals.. I replaced the ~(-> keyvals-map ... bit with ~(str/join " " (map str ~keyvals)) but this outputs the un-evaled exprs 😮

Casey12:06:52

I'm not so great with macros

Casey13:06:50

FYI, the README states: > Licensed under the term of the Mozilla Public License 2.0, see LICENSE. but LICENSE contains the eclipse public license

plexus14:06:14

oh thanks! that should be MPL, I'll fix that

plexus14:06:01

something like this perhaps?

(defn- log-expr [form level keyvals]
  `(log ~(str *ns*) ~level (str ~@(interpose " " keyvals))))

plexus14:06:47

When you do ~(str/join ...) that str/join will be evaluated at macro-expand time, which is not what you want here.