lambdaisland

plexus 2020-06-24T10:04:38.120Z

@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.

plexus 2020-06-24T10:05:06.120700Z

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

dominicm 2020-06-24T10:35:41.120800Z

Cool. Have you hand rolled them all to date?

plexus 2020-06-24T10:45:34.122600Z

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.

plexus 2020-06-24T10:50:11.123800Z

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

plexus 2020-06-24T10:50:33.124200Z

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

plexus 2020-06-24T10:51:51.124500Z

but you can have a look at https://github.com/lambdaisland/kaocha-cljs2/blob/master/src/kaocha/cljs2/funnel_client.clj for inspiration

plexus 2020-06-24T10:52:21.125100Z

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 🙂

dominicm 2020-06-24T10:54:35.125200Z

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

dominicm 2020-06-24T10:55:08.125300Z

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.

plexus 2020-06-24T11:03:14.126Z

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

Casey 2020-06-24T12:05:24.127200Z

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?

plexus 2020-06-24T12:15:07.128800Z

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

Casey 2020-06-24T12:16:46.129900Z

(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

plexus 2020-06-24T12:18:28.130600Z

what would that look like in the logs?

plexus 2020-06-24T12:19:44.131600Z

then you don't want to use Glögi

Casey 2020-06-24T12:20:05.132100Z

(sorry the slack editor was giving me problems)

plexus 2020-06-24T12:20:46.133Z

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

Casey 2020-06-24T12:20:59.133200Z

fair enough!

plexus 2020-06-24T12:21:47.134Z

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

plexus 2020-06-24T12:22:37.134600Z

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

plexus 2020-06-24T12:23:20.135Z

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

Casey 2020-06-24T12:43:42.136100Z

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

Casey 2020-06-24T12:43:53.136400Z

So looking at the formatting macro at https://github.com/lambdaisland/glogi/blob/master/src/lambdaisland/glogi.clj#L3-L12

Casey 2020-06-24T12:46:02.138100Z

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 😮

Casey 2020-06-24T12:59:52.138400Z

I'm not so great with macros

Casey 2020-06-24T13:45:50.139Z

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

kenny 2020-06-24T13:58:46.139200Z

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

plexus 2020-06-24T14:29:14.139600Z

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

plexus 2020-06-24T14:33:01.139900Z

something like this perhaps?

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

plexus 2020-06-24T14:33:47.140500Z

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

plexus 2020-06-24T14:36:31.140600Z

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

kenny 2020-06-24T14:38:21.140800Z

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?

plexus 2020-06-24T14:40:57.141Z

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.

kenny 2020-06-24T14:44:11.141500Z

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

plexus 2020-06-24T15:33:17.141700Z

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.)

kenny 2020-06-24T16:43:07.141900Z

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 🙂