Fork me on GitHub
Thomas Moerman12:10:48

I have a weird minor issue with kaocha tests with watching enabled: the suite is executed twice instead of once on change of a source file. Anyone a clue as to why this happens?

Alys Brooks01:10:10

That's odd. My first thought would normally be that your namespace includes something like (clojure.test/run-tests) inside it. Since it only happens with --watch , it could be due to your editor (or some other process) modifying some temporary file that Kaocha is watching for some reason.


Do you have tests suites defined with skip/focus?

Thomas Moerman08:10:07

@U01FJUDL57C that's the direction I'm searching in, I probably need to dig a little deeper. @U07FP7QJ0 yes, I usually run with a focus.

Thomas Moerman13:10:55

Made some progress: running twice on save is probably caused by an IntelliJ setting:

Thomas Moerman13:10:17

however the assertion count is sometimes 2x what I expect, possibly related to this issue: Not a big problem for me though, so I'm going to stop digging for now ;-)

Alys Brooks19:10:53

Fair enough. 🙂 Let us know if you find any bugs or need further troubleshooting help! If it is due to #245, then it should be fixed by upgrading to the latest Kaocha.


Please share your tests.edn, there are some patterns that we don't recommend

Thomas Moerman08:10:55

{:kaocha/tests                       [{:kaocha.testable/type :kaocha.type/clojure.test
                                       :kaocha.testable/id   :unit
                                       :kaocha/ns-patterns   ["-test$"]
                                       :kaocha/test-paths    ["src/test"]
                                       :kaocha/source-paths  ["src/main"]
                                       :kaocha.filter/focus  [
                                                              ;; ... more ...
                                                              ;; ... more ...
 :kaocha/reporter                    [;                                      
 :kaocha/fail-fast?                  false
 :kaocha/color?                      true
 :kaocha/plugins                     [:kaocha.plugin/filter ;; allows focus filter - comment out to run ALL tests
 :kaocha.plugin.profiling/count      1
 :kaocha.plugin.profiling/profiling? false
 :kaocha.plugin.randomize/randomize? false}