Fork me on GitHub
#kaocha
<
2020-12-07
>
schaueho10:12:41

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?

plexus10:12:40

what's the use case exactly?

schaueho11:12:44

Shutting down the webserver so that the socket is free when the server is restarted.

andrea.crotti10:12:38

another question about the kaocha-retry plugin, I was wondering how to report it in a usable way

andrea.crotti10:12:03

one idea would be to add something to the counters, maybe the actual map with test-id->number-of-failures

andrea.crotti10:12:24

would that be a good thing or that map of counters should not be modified?

andrea.crotti10:12:45

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?

plexus11:12:32

@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

andrea.crotti11:12:14

ah yes that's brilliant thanks great feedback

andrea.crotti11:12:41

yeah I'm not sure about using andreacrotti as the prefix, maybe I'll go with ac for all my libraries

andrea.crotti11:12:50

at least is shorter and not my full name 😄

plexus11:12:16

do you own any domain names you could use?

andrea.crotti11:12:17

but yeah everything sounds good

andrea.crotti11:12:35

a few domains but nothing I could use for libraries really

andrea.crotti11:12:00

maybe time to register one 😄

plexus11:12:44

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.

andrea.crotti11:12:38

I'm fine with andreacrotti being the group-id, a bit more annoying as library ns prefix I guess

andrea.crotti11:12:50

should they match in theory?

andrea.crotti11:12:06

I've seen quite a few libraries where they don't really match, but it's kind of annoying tbf

andrea.crotti11:12:18

since it's less trivial to know what to require

andrea.crotti15:12:00

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

andrea.crotti15:12:43

I might have to override something else, or maybe still keep the atom around and update the testable map with the atom

andrea.crotti16:12:24

I'm also not sure how to do the propagation of the retry? config

andrea.crotti16:12:00

do you know of any example of code doing that?

andrea.crotti16:12:40

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?

plexus11:12:33

hope that makes sense!

schaueho11:12:44
replied to a thread:what's the use case exactly?

Shutting down the webserver so that the socket is free when the server is restarted.

plexus11:12:35

could you use general hooks for that? start it in a pre-run , stop it in a post-run?

schaueho11:12:25

Hadn't looked into hooks yet, will give it a try. Thanks!