Fork me on GitHub
#kaocha
<
2020-12-08
>
andrea.crotti15:12:28

any reasons why post-summary would not be called at all?

andrea.crotti15:12:46

I tried to add one but nothing was happening and even:

(post-summary [result]
    (assert false))
doesn't blow up when I run kaocha.repl/run :something

andrea.crotti16:12:07

also I was trying to find a way to go through the hierarchy more easily as discussed previously but I can't really find a way to do that (I mean I can come up with something but it seems overkill), here a simplified example:

;; how do I propagate the `retry? true` from :middle to :leaf?
;; or how do I look it up at runtime assuming I have
;; `:leaf, nested`
(def
  nested
  {:val 1
   :id :root
   :tests [{:val 1
            :id :middle
            :retry? true
            :tests [{:val 2
                     :id :leaf}]}]})

plexus16:12:58

post-summary should be called from kaocha.repl/run, if the CHANGELOG is to be believed 🙂 # 1.0.658 (2020-08-17 / 22ef88c) - the post-summary hook will also be called when invoked via kaocha.repl

andrea.crotti16:12:14

mm maybe I have an older version

andrea.crotti11:12:18

mm I'm already on the latest version actually

andrea.crotti11:12:45

ah yeah it works if I calls post-summary if I call it from the CLI

andrea.crotti11:12:56

but not from kaocha.repl/run

plexus16:12:11

(pre-test [testable test-plan]
  (update testable :kaocha.test-plan/tests (partial map #(assoc % :retry? (:retry? testable)))

andrea.crotti16:12:40

ah I see that I just needed to look in the top level, I thought that I needed a generic traversal from the leaf to the suite level testable

plexus16:12:32

something like that