Skip to content

Commit

Permalink
enable/disable integration tests, test cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
jcdlbs committed May 10, 2022
1 parent fae3ccf commit 566bb9c
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 46 deletions.
77 changes: 35 additions & 42 deletions test/mirthsync/fixture_tools.clj
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,6 @@
;;;; starting data and accessor fns
(def mirths-dir "vendor/mirths")

(def mirths [{:version "3.12.0.b2650"
:sha256 "57d5790efb5fc976f7e98a47fa4acecfca39809f846975ca4450a6c42caa6f5f"
:what-happened? []}
{:version "3.11.0.b2609"
:sha256 "4df341312de34fb9a79083c5c1f8c2214cea6efd5b9d34ea0551dee4a2249286"
:what-happened? []}
{:version "3.9.0.b2526"
:sha256 "cf4cc753a8918c601944f2f4607b07f2b008d19c685d936715fe30a64dc90343"
:what-happened? []}
{:version "3.8.0.b2464"
:sha256 "e4606d0a9ea9d35263fb7937d61c98f26a7295d79b8bf83d0dab920cf875206d"
:what-happened? []}])

(def mirth-12 (nth mirths 0))
(def mirth-11 (nth mirths 1))
(def mirth-9 (nth mirths 2))
(def mirth-8 (nth mirths 3))


(defn mirth-name [mirth]
(str "mirthconnect-" (:version mirth) "-unix"))

Expand Down Expand Up @@ -112,6 +93,28 @@
select-jvm-options
remove-mirth-db)))

(def mirths [{:enabled true
:version "3.12.0.b2650"
:sha256 "57d5790efb5fc976f7e98a47fa4acecfca39809f846975ca4450a6c42caa6f5f"
:what-happened? []}
{:enabled false
:version "3.11.0.b2609"
:sha256 "4df341312de34fb9a79083c5c1f8c2214cea6efd5b9d34ea0551dee4a2249286"
:what-happened? []}
{:enabled false
:version "3.9.0.b2526"
:sha256 "cf4cc753a8918c601944f2f4607b07f2b008d19c685d936715fe30a64dc90343"
:what-happened? []}
{:enabled true
:version "3.8.0.b2464"
:sha256 "e4606d0a9ea9d35263fb7937d61c98f26a7295d79b8bf83d0dab920cf875206d"
:what-happened? []}])

(def mirth-12 (nth mirths 0))
(def mirth-11 (nth mirths 1))
(def mirth-9 (nth mirths 2))
(def mirth-8 (nth mirths 3))

(defn make-all-mirths-ready []
(ensure-target-dir)
(doall
Expand Down Expand Up @@ -145,29 +148,19 @@
(sh/destroy mirth-proc)
@exit-code))

(defn mirth-8-fixture [f]
(make-all-mirths-ready)
(let [mirth-proc (start-mirth mirth-8)]
(f)
(stop-mirth mirth-proc)))

(defn mirth-9-fixture [f]
(make-all-mirths-ready)
(let [mirth-proc (start-mirth mirth-9)]
(f)
(stop-mirth mirth-proc)))

(defn mirth-11-fixture [f]
(make-all-mirths-ready)
(let [mirth-proc (start-mirth mirth-11)]
(f)
(stop-mirth mirth-proc)))

(defn mirth-12-fixture [f]
(make-all-mirths-ready)
(let [mirth-proc (start-mirth mirth-12)]
(f)
(stop-mirth mirth-proc)))
(defn mirth-fixture
[mirth]
(fn [f]
(when (:enabled mirth)
(make-all-mirths-ready)
(let [mirth-proc (start-mirth mirth)]
(f)
(stop-mirth mirth-proc)))))

(def mirth-8-fixture (mirth-fixture mirth-8))
(def mirth-9-fixture (mirth-fixture mirth-9))
(def mirth-11-fixture (mirth-fixture mirth-11))
(def mirth-12-fixture (mirth-fixture mirth-12))

;;;;;;;;;;;;;;; The following was the original script created for
;;;;;;;;;;;;;;; fetching and validating mirth. It was ported to the
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(ns mirthsync.integration-test-8
(ns mirthsync.mirth-3-08-test
(:require [clojure.test :refer :all]
[mirthsync.core :refer :all]
[mirthsync.fixture-tools :refer :all]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(ns mirthsync.integration-test-9
(ns mirthsync.mirth-3-09-test
(:require [clojure.test :refer :all]
[mirthsync.core :refer :all]
[mirthsync.fixture-tools :refer :all]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(ns mirthsync.integration-test-11
(ns mirthsync.mirth-3-11-test
(:require [clojure.test :refer :all]
[mirthsync.core :refer :all]
[mirthsync.fixture-tools :refer :all]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(ns mirthsync.integration-test-12
(ns mirthsync.mirth-3-12-test
(:require [clojure.test :refer :all]
[mirthsync.core :refer :all]
[mirthsync.fixture-tools :refer :all]
Expand Down

0 comments on commit 566bb9c

Please sign in to comment.