2024-07-26 15:46:51 +00:00
|
|
|
(ns dda.build.devops.domain-test
|
|
|
|
(:require
|
|
|
|
[clojure.test :refer [deftest is are testing run-tests]]
|
|
|
|
[clojure.spec.test.alpha :as st]
|
|
|
|
[dda.build.devops.domain :as cut]))
|
|
|
|
|
|
|
|
(st/instrument `cut/build-path)
|
|
|
|
(st/instrument `cut/create-build-dir-command)
|
|
|
|
|
|
|
|
(deftest should-calculate-build-path
|
|
|
|
(is (= "../../target/dda-backup"
|
|
|
|
(cut/build-path {:name "dda-backup"
|
|
|
|
:project-root-path "../.."
|
|
|
|
:build-dir-name "target"
|
|
|
|
:version "4.11.8-dev"
|
2024-07-27 14:30:30 +00:00
|
|
|
:stage "dev"
|
|
|
|
:debug false
|
|
|
|
:dry-run false})))
|
2024-07-26 15:46:51 +00:00
|
|
|
(is (= "../../target/dda/backup"
|
|
|
|
(cut/build-path {:name "dda"
|
|
|
|
:module "backup"
|
|
|
|
:project-root-path "../.."
|
|
|
|
:build-dir-name "target"
|
|
|
|
:version "4.11.8-dev"
|
2024-07-27 14:30:30 +00:00
|
|
|
:stage "dev"
|
|
|
|
:debug false
|
|
|
|
:dry-run false}))))
|
2024-07-26 15:46:51 +00:00
|
|
|
|
|
|
|
(deftest should-calculate-clean-build-dir-command
|
|
|
|
(is (= ["rm" "-rf" "../../target/dda-backup"]
|
|
|
|
(cut/clean-build-dir-command {:name "dda-backup"
|
|
|
|
:project-root-path "../.."
|
|
|
|
:build-dir-name "target"
|
|
|
|
:version "4.11.8-dev"
|
2024-07-27 14:30:30 +00:00
|
|
|
:stage "dev"
|
|
|
|
:debug false
|
|
|
|
:dry-run false}))))
|
2024-07-26 15:46:51 +00:00
|
|
|
|
|
|
|
(deftest should-calculate-create-build-dir-command
|
|
|
|
(is (= ["mkdir" "-p" "../../target/dda-backup"]
|
|
|
|
(cut/create-build-dir-command {:name "dda-backup"
|
|
|
|
:project-root-path "../.."
|
|
|
|
:build-dir-name "target"
|
|
|
|
:version "4.11.8-dev"
|
2024-07-27 14:30:30 +00:00
|
|
|
:stage "dev"
|
|
|
|
:debug false
|
|
|
|
:dry-run false}))))
|
2024-07-26 15:46:51 +00:00
|
|
|
|