     (set-agent-send-off-executor! (Executors/newFixedThreadPool pool-size)))
   (try
     (let [opts (apply hash-map (map-indexed #(if (even? %1) (subs %2 1) %2) (rest args)))
-          _ (println "running with arguments:" opts)
           tests-file (first args)
-          xml-report (or (opts "report")
-                         (str "target/" (str/replace tests-file #"\.csv" "-results.xml")))
-          results (-> tests-file tests-from (exec-tests opts) summarise-results)]
-      ((juxt #(junit-report xml-report tests-file %) print-test-results) results)
+          results (-> tests-file (tests-from (opts "sheet")) (exec-tests opts) summarise-results)]
+      ((juxt #(junit-report opts tests-file %) print-test-results) results)
       (System/exit (- (results :total 0) (results :success 0))))
     (finally
       (shutdown-agents))))

   (or (and (visited x) x)
       (some #(cyclic? deps % (conj visited x)) (deps x)))))

(defmulti read-rows (fn [file]
                      (cond
                        (str/ends-with? file ".csv") :csv
                        (str/ends-with? file ".xlsx") :excel)))

(defmethod read-rows :excel [file]
  (into [] (->> (load-workbook file) sheet-seq first row-seq
                (map #(map (fn[i] (if-let [c (.getCell % i)] (str (read-cell c)) ""))
                           (range (count fields))))
                rest)))

(defmethod read-rows :csv [file]
  (with-open [in-file (io/reader file)]
    (doall (rest (csv/read-csv in-file)))))

(defn tests-from [file]
  (let [tests (->> (map #(zipmap fields %) (read-rows file))
                   (map-indexed #(-> %2 (assoc :placeholders (placeholders-of %2) :id %1)
                                     (update :extractions str->map #"\s*=\s*"))))
        extractors (for [t tests :when (:extractions t)] [(:id t) (map first (:extractions t))])

             [xml :refer [emit-str indent parse-str sexp-as-element]]]
            [clojure.java.io :as io :refer [make-parents writer]]
            [clojure.tools.logging :as log]
            [dk.ative.docjure.spreadsheet
             :refer
             [load-workbook read-cell row-seq select-sheet sheet-seq]]
            [json-path :refer [at-path]])
  (:import [clojure.data.xml CData Element]
           clojure.lang.ExceptionInfo
           java.lang.Integer
           java.text.SimpleDateFormat
           java.util.Calendar
           java.util.concurrent.Executors))

(def ^:const fields [:suite :test :url :verb :headers :payload :params :exp-status :exp-body
                     :exp-headers :options :extractions])
