Fork me on GitHub
#kaocha
<
2021-10-18
>
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.

plexus13:10:48

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: https://github.com/lambdaisland/kaocha/issues/245 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.

plexus07:10:40

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 ...
                                                              "nexus.core.model.stonepath-test"
                                                              ;; ... more ...
                                                              ]}]
 :kaocha/reporter                    [;kaocha.report/dots                                      
                                      fulcro-spec.reporters.terminal/fulcro-report
                                      ]
 :kaocha/fail-fast?                  false
 :kaocha/color?                      true
 :kaocha/plugins                     [:kaocha.plugin/filter ;; allows focus filter - comment out to run ALL tests
                                      ;:kaocha.plugin/print-invocations
                                      ;:kaocha.plugin/debug
                                      ;:kaocha.plugin/capture-output
                                      ;:kaocha.plugin/profiling
                                      ]
 :kaocha.plugin.profiling/count      1
 :kaocha.plugin.profiling/profiling? false
 :kaocha.plugin.randomize/randomize? false}