Fork me on GitHub
#kaocha
<
2020-08-23
>
amar02:08:32

Hi plexus and greater Lambda Island team. I love kaocha. We've been using it for almost 2 years now. I just started playing around with kaocha-cucumber and was able to get things to work from the CLI. I was wondering if there is a way to test/run a feature from the REPL like a Cider focused test?

plexus05:08:13

Hi @amarpotghan! There's the kaocha.repl namespace which does exactly that.

amar00:08:02

Super. Sorry should have read the docs. Thanks!

plexus06:08:37

No worries :)

plexus05:08:30

I didn't say you could only do small bugs. Everything is an incremental improvement at this point.

royalaid06:08:17

Oh definitely didn’t read into what you had said that I have to only work on specific issues. I would rather just take something small to get used to the codebase ATM

royalaid06:08:09

I dove back in once again and now:

➜ clojure -A:test -m kaocha.runner
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See  for further details.
[((..)(...)(.............)(......)(F.)(F...)(.........)(.....F)(.....)(.......)(..)(...)(..)(....)(..)(.............)(FF..FF)(.........)(...)(FFF..)(..)(..)(...............)(........................)(...........)(....)(..........................................................................................)(.)(........)(.)(..)(....)(....)(FFFFFFFF)(FF....)(....)(.)(......)(..)(..)(.............)(.)(..)(FF)(......)(.......)(...........)(FF.....FF...)(..)(.)()(...)(..................................................)(....)(.......)(.....)()(....................)(...)(..)(..)(..)(..)(F.FFFF)(....)(..)(.)(.....)(.....................................................)(....)(..)(.......)()()(....)(...........)(...........)(.......)(...)(...)(......)(..)(...........)(...............)(.)(.....)(..)(..)(F..........................................................................F)(...)(........)(F)(...)(.)(..)(....)(.....................)(...)(.........)(.)(.......................................................................)(.)(...)(......)(..........)(...)(..)(....)(..)(..............................)(.......)(.................)(....)(.........)(..)(.......)(......)(......)(....)(.)(.)(....)(..)(................................)(....)(..)(..)(..........)(....)(..)(..)(.....F)(..)(.................................)(.FF.....F........................)(..)(......)(................)(..)(....)(..)(...)(...)(...)(.)(...)(......)(F)(.)(..)(..)(....)(F.)(...)(.)(.......)(..)(........)(.)(..)(...............)(............)(..)(..)(.....)(..)(.F.F..)(........)(.)(..)(..)(..)(..........................................)(...)(..)(.....)(.)(............)(..)()(.)(.)(..........)(.)(...)(..)(..)(....)(....))]
Randomized with --seed 355021920
!!!

royalaid06:08:31

Is there an easy way to use chui-ui with kaocha that isn’t baked into the shadow build loop?

royalaid06:08:49

For reference here is the node runner I am using:

(ns kaocha-node-runner
  (:require [lambdaisland.chui.runner :as runner]
            [lambdaisland.chui.test-data :as test-data]
            [lambdaisland.glogi :as log]))
            
(log/set-levels
 '{:glogi/root :debug
   lambdaisland :all
   lambdaisland.chui.interceptor :error})

(test-data/capture-test-data!)

(defn start []
  ;; for dev, enable this to update the UI on hot reload
  ;; (ui/render! (.getElementById js/document "chui-container"))
  (runner/run-tests))

(defn stop [done]
  (runner/terminate! done))

(defn ^:export init []
  (start))

royalaid06:08:20

Which is basically a copy and pasted version of the browser runner

royalaid06:08:28

I am guessing the error

Test var xxx/yyy is known to the compiler, but was not defined at runtime. Did the file load correctly?
has something todo with my runner config and the way shadow is collecting tests?

royalaid06:08:08

OHHHHH I see what is happening, we have integration tests

royalaid06:08:28

and those are defn’s gated behind a when

plexus12:08:38

hah, glad I added a check for that, before this would have given a completely impenetrable failure deep inside chui

plexus12:08:26

> Is there an easy way to use chui-ui with kaocha that isn’t baked into the shadow build loop? can you elaborate? I'm not sure what this means. Chui-ui is not tied to Kaocha, you can include it in any build, shadow or not

royalaid13:08:56

Ideal world is the chui-ui is something is run at the command line or included with funnel

royalaid13:08:03

Which I am sure is possible at the moment but it's just a little confusing how to tell chui to run, get the tests from a remote client via funnel, and then run those tests.

royalaid13:08:33

I guess I expect chui-ui to run like the dashboard for shadow?

royalaid13:08:45

If that makes it any clearer

plexus13:08:28

yeah chui as a UI for tests that run elsewhere is definitely something interesting to try out at some point, cause then it could also act for instance as a UI for Clojure tests run by Kaocha. The UI itself is independent enough to do that without changes, but you need something like chui-remote to pump the results into chui. Currently chui-remote only does the opposite, it runs tests on demand and sends the results out from chui to somewhere else (in our case kaocha-cljs2)

plexus13:08:45

lots of use cases to consider and I can't do them all at the same time. My current priority is to make sure kaocha-cljs2 works for vanilla cljs, figwheel, and shadow, on browsers and node, and to have examples and docs for these 6 cases.

plexus13:08:23

I have a limited amount of funding from Nextjournal but that's really only for the shadow-cljs use case, and doesn't cover half of the work put in so far... I think once kaocha-cljs2 is ready for general consumption I'm going to shift gears a bit and focus more on outreach to actually get a bit of a community around this stuff. We're really going to need more contributors to keep this sustainable.

royalaid13:08:23

I will definitely see what I can do about getting a some funding from work. No promises but if we do get things integrated then we definitely have a reason to support.

plexus13:08:35

🙏:skin-tone-2: thank you! we're building up a small reserve at https://opencollective.com/lambda-island , which I actually mostly intend to use to help support other contributors.

royalaid19:08:36

@plexus did you want me to package up that node runner and provide a PR?