Skip to content

Commit

Permalink
enable multi-version testing
Browse files Browse the repository at this point in the history
  • Loading branch information
seancorfield committed Dec 17, 2023
1 parent 23ae537 commit 6a8c40c
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions run-tests.clj
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,22 @@

(require '[babashka.process :as p])

(let [maria? (= "maria" (first *command-line-args*))
(defn- run-tests [env v]
(when v (println "\nTesting Clojure" v))
(let [{:keys [exit]}
(p/shell {:extra-env env} "clojure" (str "-X"
(when v (str ":" v))
":test"))]
(when-not (zero? exit)
(System/exit exit))))

(let [maria? (some #(= "maria" %) *command-line-args*)
all? (some #(= "all" %) *command-line-args*)
env
(cond-> {"NEXT_JDBC_TEST_MSSQL" "yes"
"NEXT_JDBC_TEST_MYSQL" "yes"
"MSSQL_SA_PASSWORD" "Str0ngP4ssw0rd"}
maria?
(assoc "NEXT_JDBC_TEST_MARIA" "yes"))
{:keys [exit]}
(p/shell {:extra-env env} "clojure" "-X:test")]
(when-not (zero? exit)
(System/exit exit)))
(assoc "NEXT_JDBC_TEST_MARIA" "yes"))]
(doseq [v (if all? ["1.10" "1.11" "master"] [nil])]
(run-tests env v)))

0 comments on commit 6a8c40c

Please sign in to comment.