diff --git a/src/dda/backup/monitoring/domain.clj b/src/dda/backup/monitoring/domain.clj new file mode 100644 index 0000000..0d12fca --- /dev/null +++ b/src/dda/backup/monitoring/domain.clj @@ -0,0 +1 @@ +(ns dda.backup.monitoring.domain) \ No newline at end of file diff --git a/test/dda/backup/monitoring/domain_test.clj b/test/dda/backup/monitoring/domain_test.clj new file mode 100644 index 0000000..b19182a --- /dev/null +++ b/test/dda/backup/monitoring/domain_test.clj @@ -0,0 +1,22 @@ +(ns dda.backup.monitoring.domain-test + (:require + [clojure.test :refer [deftest is are testing run-tests]] + [clojure.spec.test.alpha :as st] + [dda.backup.monitoring.domain :as cut])) + +(deftest should-calculate-backup-files-command + (is (= [{:baseLabels {:__name__ "backup_size"}, + :docstring "Backup size in MB", + :metric {:type "gauge", + :value [{:labels + {:app_name "c4k-forgejo" + :fqdn "repo.prod.meissa.de" + :restic_repo "s3://..."}, + :value 123}]}}] + (cut/backup-files-command {:restic-repository "repo" + :backup-path "dir-at-repo" + :execution-directory "dir-to-backup" + :days-to-keep 39 + :months-to-keep 3 + :files ["file2" "file2"]})))) +