lambdaisland / lambdaisland/kaocha
Pre-validate config
Nobody has claimed this yet.
- Dominant language
- Clojure
- Stars
- 860
- Forks
- 81
- PR merge metrics
- No merged PRs in 30d
Description
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.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the malformed tests.edn configuration and trace the existing config specs and normalization step. Determine how raw configuration can be validated before normalization, then confirm that the example produces a clear validation error instead of the meta-merge exception.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- clojure
- Domain
- testing
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100