add test instrumentation
This commit is contained in:
parent
10bf635cdf
commit
7ea24fffb5
6 changed files with 29 additions and 17 deletions
|
@ -1,2 +0,0 @@
|
||||||
#!/usr/bin/env bb
|
|
||||||
|
|
|
@ -8,7 +8,6 @@
|
||||||
(let [{:keys [name]} devops]
|
(let [{:keys [name]} devops]
|
||||||
["cp" "-r" "image" (d/build-path devops)]))
|
["cp" "-r" "image" (d/build-path devops)]))
|
||||||
|
|
||||||
|
|
||||||
(defn-spec dbuild-command seq?
|
(defn-spec dbuild-command seq?
|
||||||
[devops ::d/devops]
|
[devops ::d/devops]
|
||||||
(let [{:keys [name]} devops]
|
(let [{:keys [name]} devops]
|
||||||
|
|
|
@ -1,32 +1,40 @@
|
||||||
(ns dda.devops-build.devops.domain-test
|
(ns dda.devops-build.devops.domain-test
|
||||||
(:require
|
(:require
|
||||||
[clojure.test :refer [deftest is are testing run-tests]]
|
[clojure.test :refer [deftest is are testing run-tests]]
|
||||||
|
[clojure.spec.test.alpha :as st]
|
||||||
[dda.devops-build.devops.domain :as cut]))
|
[dda.devops-build.devops.domain :as cut]))
|
||||||
|
|
||||||
|
(st/instrument `cut/build-path)
|
||||||
|
(st/instrument `cut/create-build-dir-command)
|
||||||
|
|
||||||
(deftest should-calculate-build-path
|
(deftest should-calculate-build-path
|
||||||
(is (= "../../target/dda-backup"
|
(is (= "../../target/dda-backup"
|
||||||
(cut/build-path {:name "dda-backup"
|
(cut/build-path {:name "dda-backup"
|
||||||
:project-root-path "../.."
|
:project-root-path "../.."
|
||||||
:build-dir-name "target"
|
:build-dir-name "target"
|
||||||
:version "4.11.8-dev"})))
|
:version "4.11.8-dev"
|
||||||
|
:stage "dev"})))
|
||||||
(is (= "../../target/dda/backup"
|
(is (= "../../target/dda/backup"
|
||||||
(cut/build-path {:name "dda"
|
(cut/build-path {:name "dda"
|
||||||
:module "backup"
|
:module "backup"
|
||||||
:project-root-path "../.."
|
:project-root-path "../.."
|
||||||
:build-dir-name "target"
|
:build-dir-name "target"
|
||||||
:version "4.11.8-dev"}))))
|
:version "4.11.8-dev"
|
||||||
|
:stage "dev"}))))
|
||||||
|
|
||||||
(deftest should-calculate-clean-build-dir-command
|
(deftest should-calculate-clean-build-dir-command
|
||||||
(is (= ["rm" "-rf" "../../target/dda-backup"]
|
(is (= ["rm" "-rf" "../../target/dda-backup"]
|
||||||
(cut/clean-build-dir-command {:name "dda-backup"
|
(cut/clean-build-dir-command {:name "dda-backup"
|
||||||
:project-root-path "../.."
|
:project-root-path "../.."
|
||||||
:build-dir-name "target"
|
:build-dir-name "target"
|
||||||
:version "4.11.8-dev"}))))
|
:version "4.11.8-dev"
|
||||||
|
:stage "dev"}))))
|
||||||
|
|
||||||
(deftest should-calculate-create-build-dir-command
|
(deftest should-calculate-create-build-dir-command
|
||||||
(is (= ["mkdir" "-p" "../../target/dda-backup"]
|
(is (= ["mkdir" "-p" "../../target/dda-backup"]
|
||||||
(cut/create-build-dir-command {:name "dda-backup"
|
(cut/create-build-dir-command {:name "dda-backup"
|
||||||
:project-root-path "../.."
|
:project-root-path "../.."
|
||||||
:build-dir-name "target"
|
:build-dir-name "target"
|
||||||
:version "4.11.8-dev"}))))
|
:version "4.11.8-dev"
|
||||||
|
:stage "dev"}))))
|
||||||
|
|
||||||
|
|
|
@ -1,14 +1,20 @@
|
||||||
(ns dda.devops-build.image.domain-test
|
(ns dda.devops-build.image.domain-test
|
||||||
(:require
|
(:require
|
||||||
[clojure.test :refer [deftest is are testing run-tests]]
|
[clojure.test :refer [deftest is are testing run-tests]]
|
||||||
|
[clojure.spec.test.alpha :as st]
|
||||||
[dda.devops-build.image.domain :as cut]))
|
[dda.devops-build.image.domain :as cut]))
|
||||||
|
|
||||||
|
(st/instrument `cut/copy-image-command)
|
||||||
|
(st/instrument `cut/dbuild-command)
|
||||||
|
|
||||||
|
|
||||||
(deftest should-calculate-copy-image-command
|
(deftest should-calculate-copy-image-command
|
||||||
(is (= ["cp" "-r" "image" "../../target/dda-backup"]
|
(is (= ["cp" "-r" "image" "../../target/dda-backup"]
|
||||||
(cut/copy-image-command {:name "dda-backup"
|
(cut/copy-image-command {:name "dda-backup"
|
||||||
:project-root-path "../.."
|
:project-root-path "../.."
|
||||||
:build-dir-name "target"
|
:build-dir-name "target"
|
||||||
:version "4.11.8-dev"}))))
|
:version "4.11.8-dev"
|
||||||
|
:stage "dev"}))))
|
||||||
|
|
||||||
(deftest should-calculate-dbuild-command
|
(deftest should-calculate-dbuild-command
|
||||||
(is (= ["docker"
|
(is (= ["docker"
|
||||||
|
@ -21,5 +27,6 @@
|
||||||
(cut/dbuild-command {:name "dda-backup"
|
(cut/dbuild-command {:name "dda-backup"
|
||||||
:project-root-path "../.."
|
:project-root-path "../.."
|
||||||
:build-dir-name "target"
|
:build-dir-name "target"
|
||||||
:version "4.11.8-dev"}))))
|
:version "4.11.8-dev"
|
||||||
|
:stage "dev"}))))
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue