add first test
This commit is contained in:
parent
1dac340644
commit
2fb682e94b
2 changed files with 23 additions and 0 deletions
1
src/dda/backup/monitoring/domain.clj
Normal file
1
src/dda/backup/monitoring/domain.clj
Normal file
|
@ -0,0 +1 @@
|
||||||
|
(ns dda.backup.monitoring.domain)
|
22
test/dda/backup/monitoring/domain_test.clj
Normal file
22
test/dda/backup/monitoring/domain_test.clj
Normal 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"]}))))
|
||||||
|
|
Loading…
Reference in a new issue