This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-11-27
Channels
- # announcements (2)
- # aws (17)
- # babashka (13)
- # beginners (84)
- # calva (46)
- # chlorine-clover (40)
- # cider (19)
- # clojure (27)
- # clojure-australia (1)
- # clojure-europe (84)
- # clojure-nl (2)
- # clojure-uk (49)
- # clojurescript (65)
- # core-async (6)
- # cryogen (1)
- # cursive (11)
- # datomic (13)
- # etaoin (3)
- # jackdaw (5)
- # jobs (2)
- # kaocha (34)
- # minimallist (6)
- # off-topic (17)
- # pathom (2)
- # pedestal (11)
- # re-frame (8)
- # reagent (5)
- # rewrite-clj (19)
- # shadow-cljs (30)
Is such a thing as cljc
tests possible? That is, tests that run in both cljs
and clj
. (I want to test some macros that are defined in cljc
🙂 )
Turns out it is; HoneySQL is a library with such tests! https://clojurians.slack.com/archives/C03S1KBA2/p1606436180241300
Sure, we do this for instance in lambdaisland.uri , using kaocha and kaocha-cljs https://github.com/lambdaisland/uri
Cool, a different way to do it. How do you run them?
It’s probably obvious to people more well versed with clj
and deps.edn
- I’m still getting into it.
Right you are 🙂 Thanks.
I've done a first crude attempt to retry tests automatically https://github.com/lambdaisland/kaocha/pull/176 It's not really working as hoped for and I would it's a bad idea to do it that way, but so for I could not think of another way.
That's cool @andrea.crotti. Why don't you go ahead and release this yourself? the whole point of the plugin infrastructure is that anyone can release a plugin. That way it's easy and cheap for people to experiment with ideas. Once it's in core we are committed to supporting it forever, and to not break or change its existing behavior.
yeah well I didn't open the PR to merge it sorry (that's why it's just a draft)
just to have something to show to understand what I'm doing wrong
but yeah eventually when it works I can deploy it myself surely
but it's quite far from actually working atm
I'd just like to understand if you have any suggestions about how you would do that
sure, I would start by using a more fine grained hook. Do you absolutely want to run all tests first before retrying, or is it also fine to retry a failing test immediately?
you're using post-run
which returns a full nested test plan, you'll need a lot more logically to correctly deal with that. If you can use post-test
then you can deal with one test at a time
ah yes I haven't tried post-test but that looks more suitable
and yeah I saw failed? but I needed to get the l ist of failed tests
which I could not get from failed?
ah good point I didn't try that
and the other question is how to make the reporting work (discarding the runs where the test failed)
but maybe if I use the other more granular hook it will work directly
that's harder... you'll have to intercept the reporting events first, and then replay them if necessary
ah ok yeah I see
and last question is if makes sense to use kaocha.repl/run
in a plugin
you can use pre-report
to intercept reporting events, change failing events to succeeding for instance, then replay the failure if all retries fail
ah cool yeah lots of possibilities
ok thanks I'll try a few more things
hmmm no I wouldn't use repl/run
in a plugin. The repl
namespace is really only meant for direct repl use, not as an API
ah yeah I thought it wasn't a great idea