kaocha

Eugen 2022-08-26T21:41:16.686799Z

hi, does anyone using/interested in kaocha with hyperfidle-rcf in a polylith project ? I'm trying to figure out how to run RCF tests in my source files and it does not seem to work, not sure yet why. I created a repro here: https://github.com/imrekoszo/polylith-kaocha/pull/7 . Hints / help is appreciated

imre 2022-08-29T09:30:51.225719Z

That’s what I was recommending to Eugen before. To me it appears these are a different test type. If nothing more, they would probably benefit from being discovered not only from test-paths but src-paths as well

Eugen 2022-08-29T09:34:14.279849Z

thanks for the feedback @imre. FYI, I added an example projectc -> rfc in polylith-kaocha PR. bare kaocha in bases/rfc works fine. Tests in src/ are discovered:

cd bases/rfc && clojure -M:itest-runner 

--- unit (clojure.test) ---------------------------
polylith-kaocha.rcf.sample-test
  RCF__4
  RCF__4✅

polylith-kaocha.rcf.test-ns
  RCF__4
  RCF__4✅

polylith-kaocha.rcf.src-ns
  RCF__polylith-kaocha_rcf_src-ns__4
  RCF__polylith-kaocha_rcf_src-ns__4✅
--- generative-fdef-checks (clojure.spec.test.check) ---------------------------
3 tests, 3 assertions, 0 failures.
Tests with polylith-kaocha are not discovered under src/

imre 2022-08-29T09:35:20.725829Z

thanks, will check it

👍 1
plexus 2022-08-27T10:04:44.545719Z

Would you mind creating an issue in the kaocha repo regarding RCF? It's not something we've looked into before, but perhaps it makes sense to have an explicit kaocha-rcf test type implementation. I see they have clojure.test support, so maybe that's enough, but maybe it makes sense to have more direct support.

Eugen 2022-08-27T10:29:44.688179Z

cool, I will. thanks

Eugen 2022-08-26T23:03:49.694559Z

hi, in orther to solve the above + some more. I am trying to expose the kaocha cli api or something very similar in polylith-kaocha . I checked kaocha.runner ns but I saw most of the things there are private. Any ideas on how I might best do this? Should I just copy paste the values / functions and update them ?

imre 2022-08-29T17:06:02.031049Z

I found when working on polylith-kaocha that kaocha itself seemingly has some amount of logic duplication between its repl/main/-X entry points. I also seem to remember about some discussion somewhere mentioning that cleanup/refactor towards DRY would be beneficial there. I’m wondering if that’s still the case and whether something reusable could fall out of that.

plexus 2022-08-27T09:59:20.242119Z

kaocha.runner is not an extension API, it's specifically an entry point for use from a terminal. For any kind of programmatic access you want to use kaocha.api. You can look at kaocha.runner, kaocha.repl, kaocha-boot, as examples of how to create an entry point based on kaocha.api.

Eugen 2022-08-27T10:31:33.799359Z

I understand. poly has a cli api as well. thinking about integrating them easily

Eugen 2022-08-27T10:51:23.263809Z

I thought about delegating cli args to kaocha directly

plexus 2022-08-27T11:08:33.671649Z

Would this help for supporting polylith? https://github.com/lambdaisland/kaocha/issues/305

Eugen 2022-08-27T14:35:48.938189Z

the description relates to how polylith projects are organized and work. I don't know if that is the cause

Eugen 2022-08-27T14:36:14.074179Z

I linked my PR with the info I have