kaocha

Official support channel: https://clojureverse.org/c/projects/kaocha
amar 2020-08-23T02:34:32.085500Z

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?

plexus 2020-08-23T05:53:13.086500Z

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

amar 2020-08-24T00:45:02.109700Z

Super. Sorry should have read the docs. Thanks!

plexus 2020-08-24T06:46:37.110800Z

No worries :)

plexus 2020-08-23T05:57:30.087700Z

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

2020-08-23T06:20:09.088300Z

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 <http://www.slf4j.org/codes.html#StaticLoggerBinder> 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
!!!

2020-08-23T06:21:31.089100Z

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

2020-08-23T06:24:49.089600Z

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

2020-08-23T06:25:20.090100Z

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

2020-08-23T06:35:28.091Z

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?

2020-08-23T06:51:08.091500Z

OHHHHH I see what is happening, we have integration tests

2020-08-23T06:51:28.092Z

and those are defn’s gated behind a when

2020-08-23T06:56:17.092200Z

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

plexus 2020-08-23T12:08:38.093Z

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

plexus 2020-08-23T12:09:26.093700Z

> 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

2020-08-23T13:19:56.094700Z

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

2020-08-23T13:22:03.097900Z

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.

2020-08-23T13:22:33.099Z

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

2020-08-23T13:22:45.099600Z

If that makes it any clearer

plexus 2020-08-23T13:24:28.101400Z

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)

plexus 2020-08-23T13:26:45.102500Z

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.

plexus 2020-08-23T13:29:23.104300Z

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.

2020-08-23T13:34:23.108Z

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.

plexus 2020-08-23T13:36:35.108900Z

🙏: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.

2020-08-23T19:14:36.109600Z

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