Fix schema test

This commit is contained in:
bom 2024-07-02 16:19:48 +02:00
parent 63dcc3357a
commit 830b19be58
2 changed files with 26 additions and 16 deletions

View file

@ -38,6 +38,12 @@ def initialize(project):
build.initialize_build_dir() build.initialize_build_dir()
@task
def test(project):
test_clj(project)
test_cljs(project)
test_schema(project)
@task @task
def test_clj(project): def test_clj(project):
run("lein test", shell=True, check=True) run("lein test", shell=True, check=True)

View file

@ -4,6 +4,7 @@
[clojure.spec.alpha :as s] [clojure.spec.alpha :as s]
#?(:clj [orchestra.core :refer [defn-spec]] #?(:clj [orchestra.core :refer [defn-spec]]
:cljs [orchestra.core :refer-macros [defn-spec]]) :cljs [orchestra.core :refer-macros [defn-spec]])
[dda.c4k-common.common :as cm]
[dda.c4k-common.yaml :as yaml] [dda.c4k-common.yaml :as yaml]
[dda.c4k-common.postgres :as postgres] [dda.c4k-common.postgres :as postgres]
[dda.c4k-common.monitoring :as mon] [dda.c4k-common.monitoring :as mon]
@ -26,22 +27,25 @@
(defn config-objects [config] (defn config-objects [config]
(let [storage-class (if (contains? config :postgres-data-volume-path) :manual :local-path)] (let [storage-class (if (contains? config :postgres-data-volume-path) :manual :local-path)]
(map yaml/to-string (map yaml/to-string
[(postgres/generate-config {:postgres-size :2gb :db-name "shynet"}) (filter
(when (contains? config :postgres-data-volume-path) #(not (nil? %))
(postgres/generate-persistent-volume (select-keys config [:postgres-data-volume-path :pv-storage-size-gb]))) (cm/concat-vec
(postgres/generate-pvc {:pv-storage-size-gb 20 [(postgres/generate-config {:postgres-size :2gb :db-name "shynet"})
:pvc-storage-class-name storage-class}) (when (contains? config :postgres-data-volume-path)
(postgres/generate-deployment {:postgres-image "postgres:14" (postgres/generate-persistent-volume (select-keys config [:postgres-data-volume-path :pv-storage-size-gb])))
:postgres-size :2gb}) (postgres/generate-pvc {:pv-storage-size-gb 20
(postgres/generate-service config) :pvc-storage-class-name storage-class})
(shynet/generate-webserver-deployment) (postgres/generate-deployment {:postgres-image "postgres:14"
(shynet/generate-celeryworker-deployment) :postgres-size :2gb})
(shynet/generate-ingress-and-cert config) (postgres/generate-service config)
(shynet/generate-service-redis) (shynet/generate-webserver-deployment)
(shynet/generate-service-webserver) (shynet/generate-celeryworker-deployment)
(shynet/generate-statefulset) (shynet/generate-service-redis)
(when (:contains? config :mon-cfg) (shynet/generate-service-webserver)
(mon/generate (:mon-cfg config) (:mon-auth config)))]))) (shynet/generate-statefulset)]
(shynet/generate-ingress-and-cert config)
(when (:contains? config :mon-cfg)
(mon/generate (:mon-cfg config) (:mon-auth config))))))))
(defn auth-objects [config] (defn auth-objects [config]
(map yaml/to-string (map yaml/to-string