Skip to content

Pre-validate config #219

@plexus

Description

@plexus

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ergonomicsMaking Kaocha delightful to work with and people more efficientonboardingMake Kaocha easier for people or projects new to it

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    Candidate

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions