From 0db2059c3fb8eb393fd67e2814fb44de14672b00 Mon Sep 17 00:00:00 2001 From: bom Date: Fri, 25 Aug 2023 12:47:11 +0200 Subject: [PATCH] Validate valid config/auth --- src/test/cljc/dda/c4k_taiga/core_test.cljc | 9 +++++---- .../{website-test => taiga-test}/valid-auth.yaml | 12 ++++++------ .../{website-test => taiga-test}/valid-config.yaml | 0 3 files changed, 11 insertions(+), 10 deletions(-) rename src/test/resources/{website-test => taiga-test}/valid-auth.yaml (58%) rename src/test/resources/{website-test => taiga-test}/valid-config.yaml (100%) diff --git a/src/test/cljc/dda/c4k_taiga/core_test.cljc b/src/test/cljc/dda/c4k_taiga/core_test.cljc index a771259..a5de164 100644 --- a/src/test/cljc/dda/c4k_taiga/core_test.cljc +++ b/src/test/cljc/dda/c4k_taiga/core_test.cljc @@ -5,14 +5,15 @@ :cljs [cljs.test :refer-macros [deftest is are testing run-tests]]) [clojure.spec.alpha :as s] [dda.c4k-common.yaml :as yaml] - [dda.c4k-taiga.core :as cut] - [clojure.spec.alpha :as s])) + [dda.c4k-taiga.core :as cut])) #?(:cljs (defmethod yaml/load-resource :website-test [resource-name] (case resource-name + "taiga-test/valid-config.yaml" (rc/inline "taiga-test/valid-config.yaml") + "taiga-test/valid-auth.yaml" (rc/inline "taiga-test/valid-auth.yaml") (throw (js/Error. "Undefined Resource!"))))) (deftest validate-valid-resources - ;(is (s/valid? cut/config? (yaml/load-as-edn "website-test/valid-config.yaml"))) - ) + (is (s/valid? cut/config? (yaml/load-as-edn "taiga-test/valid-config.yaml"))) + (is (s/valid? cut/auth? (yaml/load-as-edn "taiga-test/valid-auth.yaml")))) diff --git a/src/test/resources/website-test/valid-auth.yaml b/src/test/resources/taiga-test/valid-auth.yaml similarity index 58% rename from src/test/resources/website-test/valid-auth.yaml rename to src/test/resources/taiga-test/valid-auth.yaml index 947747b..6ed8858 100644 --- a/src/test/resources/website-test/valid-auth.yaml +++ b/src/test/resources/taiga-test/valid-auth.yaml @@ -1,14 +1,14 @@ taiga-secret-key: "some-key" postgres-db-user: "forgejo" postgres-db-password: "forgejo-db-password" -mailer-user: "" -mailer-pw: "" +mailer-user: "mailer-user" +mailer-pw: "mailer-pw" django-superuser-username: "taiga-admin" -django-superuser-password: "" +django-superuser-password: "super-password" django-superuser-email: "some@example.com" -rabbitmq-user: "" -rabbitmq-pw: "" -rabbitmq-erlang-cookie: "" +rabbitmq-user: "rabbit-user" +rabbitmq-pw: "rabbit-pw" +rabbitmq-erlang-cookie: "rabbit-erlang" mon-auth: grafana-cloud-user: "user" grafana-cloud-password: "password" diff --git a/src/test/resources/website-test/valid-config.yaml b/src/test/resources/taiga-test/valid-config.yaml similarity index 100% rename from src/test/resources/website-test/valid-config.yaml rename to src/test/resources/taiga-test/valid-config.yaml