kaocha

Official support channel: https://clojureverse.org/c/projects/kaocha
daniel.spaniel 2019-10-07T12:18:38.003Z

Is there a way to set config variables when running koacha? For example our application runs with a mount/start state :config variable that sets up some variables for the application to use. Since tests don't mount/start I am trying to send in to koacha ( before it runs ) some config variables or even try to set that mount state config variable like this:

daniel.spaniel 2019-10-07T12:18:41.003300Z

(ns setup-test
  (:require [mount.core :as mount]))

(def test-config
  {:conn               :mem-conn
   :certificate-secret "cert-secret"
   :secret             "secret"
   :encrypt-secret     "encrypt-secret"})

(defn test-setup [_]
  (mount/start-with
    {#'dataico.server-components.config/config (fn [_] test-config)}))

(clojure.test/use-fixtures :once test-setup)

daniel.spaniel 2019-10-07T12:19:19.004100Z

but this is pretty stupid because though it works .. it is a "test" file .. and since we running randomized tests it might run who knows when

daniel.spaniel 2019-10-07T12:20:00.005Z

so is there a way to run this file first thing before any tests or is there another way to set that config mount state ? up front ?

plexus 2019-10-07T12:23:17.005300Z

I think hooks are what you are looking for

plexus 2019-10-07T12:25:00.005600Z

There's a brief description of the available hooks in the plugin writing docs https://cljdoc.org/d/lambdaisland/kaocha/0.0-549/doc/9-extending#extension-types

daniel.spaniel 2019-10-07T13:25:06.006700Z

your right @plexus... that is what i am looking for. thanks for letting me know 🙂