Fork me on GitHub
#kaocha
<
2022-08-26
>
Eugen21:08:16

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

plexus10:08:44

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.

Eugen10:08:44

cool, I will. thanks

imre09:08:51

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

Eugen09:08:14

thanks for the feedback @U08BJGV6E. 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/

imre09:08:20

thanks, will check it

👍 2
Eugen23:08:49

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 ?

plexus09:08:20

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.

Eugen10:08:33

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

Eugen10:08:23

I thought about delegating cli args to kaocha directly

Eugen14:08:48

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

Eugen14:08:14

I linked my PR with the info I have

imre17:08:02

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.