-
-
Notifications
You must be signed in to change notification settings - Fork 96
Expand file tree
/
Copy pathbb.edn
More file actions
71 lines (64 loc) · 3.15 KB
/
bb.edn
File metadata and controls
71 lines (64 loc) · 3.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
;; all tasks that run tests can also accept:
;; all - run tests against all supported Clojure versions
;; local - only test local DBs (H2, HSQLDB, SQLite, Derby)
;; maria - test MariaDB (and MySQL) drivers only
;; 1.10/1.11/1.12 - run only against the specified Clojure version (defaults to 1.12)
;; jdk11/jdk17/jdk21/jdk25 - indicate which JDK you are using (defaults to jdk25)
{:tasks
{:requires [[clojure.string :as str]]
test {:doc "Run the test suite."
:task
(let [maria? (some #{"maria"} *command-line-args*) ; test mariadb driver?
local? (some #{"local"} *command-line-args*) ; only test local dbs?
all? (some #{"all"} *command-line-args*) ; test all clojure versions?
versions (or (seq (filter (fn [v] (str/starts-with? v "1."))
*command-line-args*))
["1.12"])
base-jdk (first (filter (fn [v] (str/starts-with? v "jdk"))
*command-line-args*))
jdk (or base-jdk
;; sean's local default:
"jdk25")
env
(cond local?
{}
maria?
{"NEXT_JDBC_TEST_MARIADB" "yes"
"NEXT_JDBC_TEST_MYSQL" "yes"}
:else
{"NEXT_JDBC_TEST_MSSQL" "yes"
"NEXT_JDBC_TEST_MYSQL" "yes"
"NEXT_JDBC_TEST_XTDB" "yes"
"MSSQL_SA_PASSWORD" "Str0ngP4ssw0rd"})]
;; since we test xtdb by default now, we default to 1.12:
(doseq [v (if all? ["1.10" "1.11" "1.12"] versions)]
(println "\nTesting Clojure" v)
(shell {:extra-env env}
"clojure"
(str "-M"
(str ":" v)
":test:runner"
;; jdk21+ adds xtdb:
(when (and (get env "NEXT_JDBC_TEST_XTDB")
(not base-jdk))
":jdk21")
;; add jdk-specific alias if provided
":" jdk))))}
test:all {:doc "Run the test suite for all Clojure versions."
:task (binding [*command-line-args* (conj *command-line-args* "all")]
(run 'test))}
-snapshot {:doc "Return snapshot options, if requested."
:task (->> (if (some #{"snapshot"} *command-line-args*)
[:snapshot true]
[])
(map str))}
ci {:doc "Run the CI pipeline of tests and build the JAR."
:depends [test:all]
:task (apply shell "clojure -T:build jar" (run '-snapshot))}
ci:deploy {:doc "Deploy the JAR we just built to Clojars."
:depends [ci]
:task (apply shell "clojure -T:build deploy" (run '-snapshot))}
docker:up {:doc "Start the Docker containers for testing."
:task (shell "docker compose up -d")}
docker:down {:doc "Stop the Docker containers."
:task (shell "docker compose down")}}}