 
 (defn- remap-date-first [[job runtimes-by-day]]
   (map (fn [[day avg-runtime]]
-              [day {job avg-runtime}])
-            runtimes-by-day))
+         [day {job avg-runtime}])
+       runtimes-by-day))
 
 (defn- merge-runtimes [all-runtimes-by-day]
   (->> (mapcat remap-date-first all-runtimes-by-day)

(defn- failures-for [build-results job-name]
  (when-some [test-results (results/chronological-tests build-results job-name)]
    (when-some [failed-tests (seq (testsuites/accumulate-testsuite-failures
                                  (map junit-xml/parse-testsuites test-results)))]
      (let [build-data-entries (results/builds build-results job-name)]
        {job-name (merge {:children failed-tests}
                    (failed-count-for build-data-entries))}))))

(defn- failures-as-list [build-results job-name]
  (when-some [test-results (results/chronological-tests build-results job-name)]

(ns buildviz.handler
  (:use
   ring.middleware.json
   ring.middleware.resource
   ring.middleware.content-type
   ring.middleware.not-modified
   ring.middleware.accept
   ring.util.response
   [compojure.core :only (GET PUT)]
   [clojure.string :only (join escape)])
  (:require [buildviz.build-results :as results]
            [buildviz.http :as http]
            [buildviz.junit-xml :as junit-xml]
