add first test

This commit is contained in:
Michael Jerger 2024-08-30 14:47:07 +02:00
parent 1dac340644
commit 2fb682e94b
2 changed files with 23 additions and 0 deletions

View file

@ -0,0 +1 @@
(ns dda.backup.monitoring.domain)

View file

@ -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"]}))))