HPS (Hierarchy Property Service): Initial Setup

First steps for HPS (Hierarchy Property Service)

Ok, after the first problems I was able to start coding.
Because I want TDD I was really missing lein-test-refresh, but after some research I found Kaocha

Kaocha

Basically is a full fledged tool for Testing. 
There are some steps to do to just have an initial setup:
  • Add a dependency on your deps.edn
    • :aliases {:test {:extra-paths ["src/test/clojure"] :extra-deps {lambdaisland/kaocha {:mvn/version "1.0.641"}}
  • Do your setup of kaocha, basically create a script at ~/bin/kaocha and chmod +x it, inside write:
    • clojure -A:test -m kaocha.runner "$@"
  • Create a tests.edn in your foolder, (this step is needed if you don't have your tests in a test folder on the root of your project):
    • #kaocha/v1
    • {:tests [{:id :unit
                   :test-paths ["src/test/clojure"]}]}
  • #kaocha/v1 is a default configuration for kaocha, while the other one set the tests path for my project. 
  • now run in a terminal in your project root folder: 
    • ~/bin/kaocha --watch
  • There it is, automatic reload and run in parallel of all your tests 😁

First development

What I did, after setting up the TDD environment was then setting up maps that represent a hierarchy, and a in memory database (for now) done in an atom with some utility methods to store hierarchy:


And some definition of my domain objects (for now simple maps):

Again my feeling are there, Clojure is like your first love, whenever you see it again you feel well 😊

Comments