This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-05-06
Channels
- # admin-announcements (1)
- # announcements (32)
- # babashka (38)
- # beginners (91)
- # braveandtrue (1)
- # calva (1)
- # cider (9)
- # cljsrn (19)
- # clojure (129)
- # clojure-bay-area (3)
- # clojure-europe (24)
- # clojure-italy (1)
- # clojure-losangeles (1)
- # clojure-nl (2)
- # clojure-spec (10)
- # clojure-uk (24)
- # clojurescript (14)
- # community-development (7)
- # conjure (16)
- # cursive (3)
- # datomic (20)
- # defnpodcast (4)
- # emacs (11)
- # figwheel (2)
- # fulcro (5)
- # helix (6)
- # integrant (3)
- # jackdaw (5)
- # java (6)
- # jobs (1)
- # kaocha (13)
- # lsp (8)
- # malli (29)
- # meander (2)
- # off-topic (120)
- # pathom (3)
- # podcasts-discuss (6)
- # portal (6)
- # re-frame (27)
- # reagent (5)
- # releases (4)
- # remote-jobs (6)
- # rewrite-clj (9)
- # shadow-cljs (108)
- # xtdb (5)
Hi there, if I wanted to bootstrap a docker container for every suite would this work?
:kaocha/pre-load-test [com.cohesic.acuity.test/sql-test-container-start-hook]
:kaocha/pre-test [com.cohesic.acuity.test/reset-script-run-each-leaf-hook]
:kaocha/post-load-test [com.cohesic.acuity.test/sql-test-container-stop-hook]
I am using hierarchy/suite?
for filter but I was wondering if the :pre-load-test
is a good hook.
I am on 1.0.726
at the moment.asking because (kaocha.hierarchy/leaf? testable)
was returning false
all the time
I basically have to use
(= (:kaocha.testable/type testable) :kaocha.type/var)
with
:kaocha.hooks/pre-test [com.cohesic.acuity.test/sql-test-container-start-hook
com.cohesic.acuity.test/run-setup-script-each-test-hook]
:kaocha.hooks/post-test [com.cohesic.acuity.test/run-drop-script-each-test-hook
com.cohesic.acuity.test/sql-test-container-stop-hook]
actually, no that does not work either
maybe I am misunderstanding something but if I call
clojure -M:test -m kaocha.runner unit --watch
I would expect to see only the :kaocha.testable/id :unit
in the hook, is that a wrong assumption?
I see all the suites passed in and I cannot differentiate which one is being run right nowI would use pre-run
and post-run
to start/stop the container, and pre-test
to reset it
Thanks yes that now makes sense...and well I was trying another route now (kinda late here) to use wrap-run
That works, except my test has an :each
fixture that uses a dynamic var. I do binding
in wrap-run
but for some reason it arrives nil
within the test fixture
if fixtures are loaded at "load time" probably that is why I can't seem to make this work
anyways thank you for your explanation!
@U07FP7QJ0 How do you recommend checking if a test suite is "skipped"
is there an api for that?
Leaving this here if useful to some
(defn skipped-testable?
[testable id]
(let [desired-key-fn (juxt :kaocha.testable/skip :kaocha.testable/id)
skip+test-id-tuple (desired-key-fn testable)]
(= [true id] skip+test-id-tuple)))
(defn skipped-test-suite?
[test-plan id]
(some #(skipped-testable? % id) (:kaocha.test-plan/tests test-plan)))
Works against version 1.0.726
Leaving this here if useful to some
(defn skipped-testable?
[testable id]
(let [desired-key-fn (juxt :kaocha.testable/skip :kaocha.testable/id)
skip+test-id-tuple (desired-key-fn testable)]
(= [true id] skip+test-id-tuple)))
(defn skipped-test-suite?
[test-plan id]
(some #(skipped-testable? % id) (:kaocha.test-plan/tests test-plan)))
Works against version 1.0.726