Skip to content

Commit

Permalink
add --workloads-expected-to-pass, which skips tests that are allowed …
Browse files Browse the repository at this point in the history
…to fail
  • Loading branch information
aphyr committed Jan 18, 2019
1 parent 1cbe1f6 commit 046fc9f
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions src/jepsen/faunadb/runner.clj
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,14 @@
:pages {:serialized-indices [true false]}
:register {}})

(def workload-options-expected-to-pass
"Workload options restricted to just those we expect to pass."
(-> workload-options
(assoc-in [:set :strong-read] [true])
; I forget, are serialized indices necessary for set tests?
(assoc-in [:set :serialized-indices] [true])
(assoc-in [:g2 :serialized-indices] [true])))

(defn all-combos
"Takes a map of options to collections of values for that option. Computes a
collection of maps with the combinatorial expansion of every possible option
Expand All @@ -73,7 +81,7 @@
(defn all-workload-options
"Expands workload-options into all possible CLI opts for each combination of
workload options."
[]
[workload-options]
(mapcat (fn [[workload opts]]
(all-combos {:workload workload} opts))
workload-options))
Expand Down Expand Up @@ -110,6 +118,7 @@
[:topology]]
(map (fn [faults]
(zipmap faults (repeat true))))))

(defn parse-version
"Handle local package files by ignoring the path"
[opts]
Expand Down Expand Up @@ -236,7 +245,11 @@
"Test workload to run. If omitted, runs all workloads"
:parse-fn keyword
:default nil
:validate [workloads (jc/one-of workloads)]]])
:validate [workloads (jc/one-of workloads)]]

[nil "--only-workloads-expected-to-pass"
"If present, skips tests which are not expected to pass, given Fauna's docs"
:default false]])

(def single-test-opts
"Command line options for single tests"
Expand Down Expand Up @@ -282,7 +295,10 @@
:run (fn [{:keys [options]}]
(info "CLI options:\n" (with-out-str (pprint options)))
(let [w (:workload options)
workloads (cond->> (all-workload-options)
workload-opts (if (:only-workloads-expected-to-pass options)
workload-options-expected-to-pass
workload-options)
workloads (cond->> (all-workload-options workload-opts)
w (filter (comp #{w} :workload)))
tests (for [nemesis all-nemeses
workload workloads
Expand Down

0 comments on commit 046fc9f

Please sign in to comment.