kaocha

Official support channel: https://clojureverse.org/c/projects/kaocha
kardan 2020-09-11T08:45:42.027500Z

I’m a bit confused. Is spec instrumentation supposed to be on by default? Im not seeing that happening and adding a hook pre-test to enable it causes internal kaocha spec errors on id & type

kardan 2020-09-11T08:46:35.028400Z

Have to admit that Im still trying to figure out things

plexus 2020-09-11T08:47:22.028600Z

have you seen the orchestra plugin?

plexus 2020-09-11T08:47:39.029Z

I am also interested though in what you're seeing, what does your hook look like and what's the error you're getting?

kardan 2020-09-11T08:52:07.030300Z

;; tests.edn
#kaocha/v1
{:tests [{:id :all
          :type :kaocha.type/clojure.test
          :test-paths ["test"]
          :source-paths ["src" "specs" "dev/src" "dev/resources" "test/resources"]
          :kaocha.hooks/pre-test [dev.check-specs-hook]
          :kaocha.hooks/post-test [dev.uncheck-specs-hook]
          }
         ]
 :plugins [:kaocha.plugin/filter
           :kaocha.plugin/capture-output
           :kaocha.plugin/profiling
           :kaocha.plugin/hooks]
 }

;; Hook
(defn check-specs-hook [suite test-plan]
  (check-specs!) ;; fn that only does (stest/instrument)
  suite)

kardan 2020-09-11T08:53:59.030700Z

“should contain keys: :kaocha.testable/id, :kaocha.testable/type”

kardan 2020-09-11T08:55:20.031800Z

Might very well be me doing something silly, I feel a bit confused

plexus 2020-09-11T09:04:08.032900Z

no stack trace I guess? it's validating the test plan as if it's a testable, which it isn't, so that there's no id/type is fine, probably some function has too stringent an fdef defined

kardan 2020-09-11T09:06:22.033Z

No, sorry no stacktrace

plexus 2020-09-11T09:07:52.033200Z

in any case the orchestra plugin should do what you want, or if you want to instrument with spec instead of orchestra then do what that one does, i.e. use post-load hook for instrumenting, and post-run for unstrumenting

1👍
kardan 2020-09-11T09:12:23.033500Z

Thanks