test validity of valid inputs

This commit is contained in:
jerger 2022-12-28 18:25:56 +01:00
parent 497feef8ec
commit 5f08a10807
6 changed files with 33 additions and 12 deletions

View file

@ -25,8 +25,8 @@ Your input will stay in your browser. No server interaction is required.
You will also be able to try out on cli:
```
target/graalvm/c4k-jitsi src/test/resources/valid-config.edn src/test/resources/valid-auth.edn | kubeval -
target/graalvm/c4k-jitsi src/test/resources/valid-config.edn src/test/resources/valid-auth.edn | kubectl apply -f -
target/graalvm/c4k-jitsi src/test/resources/jitsi-test/valid-config.yaml src/test/resources/jitsi-test/valid-auth.yaml | kubeval -
target/graalvm/c4k-jitsi src/test/resources/jitsi-test/valid-config.yaml src/test/resources/jitsi-test/valid-auth.yaml | kubectl apply -f -
```
## Documentation

View file

@ -0,0 +1,19 @@
(ns dda.c4k-jitsi.core-test
(:require
#?(:clj [clojure.test :refer [deftest is are testing run-tests]]
:cljs [cljs.test :refer-macros [deftest is are testing run-tests]])
[clojure.spec.alpha :as s]
[dda.c4k-common.yaml :as yaml]
[dda.c4k-jitsi.core :as cut]))
#?(:cljs
(defmethod yaml/load-resource :jitsi-test [resource-name]
(case resource-name
"jitsi-test/valid-auth.yaml" (rc/inline "jitsi-test/valid-auth.yaml")
"jitsi-test/valid-config.yaml" (rc/inline "jitsi-test/valid-config.yaml")
(throw (js/Error. "Undefined Resource!")))))
(deftest validate-valid-resources
(is (s/valid? cut/config? (yaml/load-as-edn "jitsi-test/valid-config.yaml")))
(is (s/valid? cut/auth? (yaml/load-as-edn "jitsi-test/valid-auth.yaml")))
)

View file

@ -0,0 +1,6 @@
jvb-auth-password: "JvbAuth"
jicofo-auth-password: "JicofoAuth"
jicofo-component-secret: "JicofoCompSec"
mon-auth:
grafana-cloud-user: "user"
grafana-cloud-password: "password"

View file

@ -0,0 +1,6 @@
fqdn: "jitsi.test.meissa-gmbh.de"
issuer: "staging"
mon-cfg:
grafana-cloud-url: "url-for-your-prom-remote-write-endpoint"
k3s-cluster-name: "jitsi"
k3s-cluster-stage: "test"

View file

@ -1,5 +0,0 @@
{:jvb-auth-password "JvbAuth"
:jicofo-auth-password "JicofoAuth"
:jicofo-component-secret "JicofoCompSec"
:mon-auth {:grafana-cloud-user "user"
:grafana-cloud-password "password"}}

View file

@ -1,5 +0,0 @@
{:fqdn "jitsi.test.meissa-gmbh.de"
:issuer "staging"
:mon-cfg {:grafana-cloud-url "url-for-your-prom-remote-write-endpoint"
:k3s-cluster-name "jitsi"
:k3s-cluster-stage "test"}}