       (let [build-data-entries (vals (@builds job))]
         {job (merge {:children failed-tests}
                     (failed-count-for build-data-entries))}))))
-
-(defn- serialize-nested-testsuites [testsuite-id]
-  (join ": " testsuite-id))
 
 (defn- failures-as-list [job]
   (when-let [test-results (@test-results job)]

(defn- get-testsuites [accept]
  (let [job-names (filter has-testsuites? (keys @builds))]
    (if (= (:mime accept) :json)
      {:body (zipmap job-names (map testsuites-for job-names))}
      {:body (csv/export-table ["averageRuntime" "job" "testsuite" "classname" "name"]
                               (mapcat flat-test-runtimes
                                       job-names))})))

;; app


        buildSummaries (map summary-for jobNames)
        buildSummary (zipmap jobNames buildSummaries)]
    (if (= (:mime accept) :json)
      (respond-with-json buildSummary)
      (respond-with-csv
       (csv/export-table ["job" "averageRuntime" "totalCount" "failedCount" "flakyCount"]
                         (map (fn [[job-name job]] [job-name
                                                    (csv/format-duration (:averageRuntime job))
                                                    (:totalCount job)
                                                    (:failedCount job)
                                                    (:flakyCount job)])
                              buildSummary))))))

;; fail phases

