kaocha icon indicating copy to clipboard operation
kaocha copied to clipboard

Pre-validate config

Open plexus opened this issue 4 years ago • 1 comments

Certain configuration mistakes still cause rather unhelpful error messages, because we validate the config after normalizing it, so errors during normalization aren't cleanly handled.

Case in point, I just accidentally did this

#kaocha/v1
{:tests {:id :cljs
         :type :kaocha.type/cljs}}

Which should have been

#kaocha/v1
{:tests [{:id :cljs :type :kaocha.type/cljs}]}

Which gave me this error

Execution error (IllegalArgumentException) at meta-merge.core/meta-merge (core.cljc:100).
Don't know how to create ISeq from: clojure.lang.Keyword

Full report at:
/tmp/clojure-7895642946752562024.edn

This one's a bit annoying because we do have specs for config maps, but they only apply after normalization, adding defaults, renaming non-qualified keys etc. We'll need seperate specs (or a different validation strategy) if we want to validate the raw tests.edn.

plexus avatar Apr 14 '21 07:04 plexus

I think validation is important enough that we want to keep this feature idea open.

alysbrooks avatar Jul 03 '23 23:07 alysbrooks