Skip to content

Commit b52ef9d

Browse files
committed
runner all-test
Needed for #34
1 parent a500a9a commit b52ef9d

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
@@ -49,6 +49,10 @@
4949
;:pages pages/workload
5050
:register register/workload})
5151

52+
(def standard-workloads
53+
"The workload names we run for test-all by default."
54+
(keys workloads))
55+
5256
(def workload-options
5357
"For each workload, a map of workload options to all the values that option
5458
supports."
@@ -148,10 +152,23 @@
148152
:exceptions (checker/unhandled-exceptions)
149153
:workload (:checker workload)})})))
150154

155+
(defn all-tests
156+
"Takes parsed CLI options and constructs a sequence of test options, by
157+
combining all workloads and nemeses."
158+
[opts]
159+
(let [nemeses (if-let [n (:nemesis opts)] [n] standard-nemeses)
160+
workloads (if-let [w (:workload opts)] [w] standard-workloads)
161+
counts (range (:test-count opts))]
162+
(->> (for [i counts, n nemeses, w workloads]
163+
(assoc opts :nemesis n :workload w))
164+
(map tarantool-test))))
165+
151166
(defn -main
152167
"Handles command line arguments."
153168
[& args]
154169
(cli/run! (merge (cli/single-test-cmd {:test-fn tarantool-test
155170
:opt-spec cli-opts})
171+
(cli/test-all-cmd {:test-fn all-tests
172+
:opt-spec cli-opts})
156173
(cli/serve-cmd))
157174
args))

0 commit comments

Comments
 (0)