Hi. I have a question wrt. the reloading/watch feature: is it possible to run a function before refresh, like you would do in a manual refresh?
what's the use case exactly?
another question about the kaocha-retry plugin, I was wondering how to report it in a usable way
one idea would be to add something to the counters, maybe the actual map with test-id->number-of-failures
would that be a good thing or that map of counters should not be modified?
also related to the hierarchy question, is there anything to navigate in the hierarchy and get from a leaf testable to the group (like :unit
for example) where the settings would be defined?
@andrea.crotti some feedback on your code
- get rid of those top level atoms, you should be able to stick them in the test plan / testable
- for the configuration, I would propagate (copy) from each testable to its children. So you can set it at the top level config, or at a test suite. Either way it'll get copied to the leaves so you can just check it there.
- Might also be really useful to allow setting these from metadata, so you can mark specific flaky tests. (deftest ^{:andreacrotti.kaocha-retry/max-retries 5} my-flaky-test)
- For reporting I would use post-summary
and print out a separate "flaky tests" report, stick the fail/pass numbers (or even all the captured events) onto the testable, then walk the tree and print out messages foo-bar failed 3 times out of 4
or something like that
hope that makes sense!
ah yes that's brilliant thanks great feedback
yeah I'm not sure about using andreacrotti
as the prefix, maybe I'll go with ac
for all my libraries
at least is shorter and not my full name 😄
do you own any domain names you could use?
but yeah everything sounds good
a few domains but nothing I could use for libraries really
maybe time to register one 😄
ac
seems very short and potentially ambigious... but I'm not here to police that. and plenty of people in the clojure world could/should reconsider how they deal with naming prefixes.
https://clojurians-log.clojureverse.org/clojure/2020-12-04/1607095717.050200
could you use general hooks for that? start it in a pre-run , stop it in a post-run?
Hadn't looked into hooks yet, will give it a try. Thanks!
ah ok thanks
I'm fine with andreacrotti being the group-id, a bit more annoying as library ns prefix I guess
should they match in theory?
I've seen quite a few libraries where they don't really match, but it's kind of annoying tbf
since it's less trivial to know what to require
I started to get rid of the atoms @plexus https://github.com/AndreaCrotti/kaocha-retry/pull/1/files#diff-6fda99f028427242e88c9821a47ea48b7f92d049d5cb6c644e3a40bcf8035c88R52
but I'm a bit stuck because the number of attempts done is returned in that hook, I can't really update the testable map from there
I might have to override something else, or maybe still keep the atom around and update the testable map with the atom
I'm also not sure how to do the propagation of the retry? config
do you know of any example of code doing that?
maybe that should be the default? Is it useful to have config on :unit
for example that would not be inherited by the leafs tests?