Skip to content

Commit cd643d7

Browse files
committed
runner all-test
1 parent 91046d0 commit cd643d7

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/tarantool/runner.clj

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@
4848
;:pages pages/workload
4949
:register register/workload})
5050

51+
(def standard-workloads
52+
"The workload names we run for test-all by default."
53+
(keys workloads))
54+
5155
(def workload-options
5256
"For each workload, a map of workload options to all the values that option
5357
supports."
@@ -145,10 +149,23 @@
145149
:exceptions (checker/unhandled-exceptions)
146150
:workload (:checker workload)})})))
147151

152+
(defn all-tests
153+
"Takes parsed CLI options and constructs a sequence of test options, by
154+
combining all workloads and nemeses."
155+
[opts]
156+
(let [nemeses (if-let [n (:nemesis opts)] [n] standard-nemeses)
157+
workloads (if-let [w (:workload opts)] [w] standard-workloads)
158+
counts (range (:test-count opts))]
159+
(->> (for [i counts, n nemeses, w workloads]
160+
(assoc opts :nemesis n :workload w))
161+
(map tarantool-test))))
162+
148163
(defn -main
149164
"Handles command line arguments."
150165
[& args]
151166
(cli/run! (merge (cli/single-test-cmd {:test-fn tarantool-test
152167
:opt-spec cli-opts})
168+
(cli/test-all-cmd {:test-fn all-tests
169+
:opt-spec cli-opts})
153170
(cli/serve-cmd))
154171
args))

0 commit comments

Comments
 (0)