Skip to content

Commit

Permalink
Exit with non-0 status code on failure
Browse files Browse the repository at this point in the history
  • Loading branch information
julienvincent committed Aug 5, 2024
1 parent 60df404 commit 7494d94
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
5 changes: 2 additions & 3 deletions src/k16/forge/reporting.clj
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,5 @@

results))

(defn print-summary [results]
(let [summary (calculate-summary results)]
(puget/pprint summary puget-opts)))
(defn print-summary [summary]
(puget/pprint summary puget-opts))
9 changes: 6 additions & 3 deletions src/k16/forge/runner.clj
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,13 @@
(->> namespaces
(mapv (fn [test-ns]
(.submit pool ^Callable (fn [] (run-test-ns test-ns)))))
(mapv deref))]
(mapv deref))

summary (reporting/calculate-summary results)
failed? (< 0 (-> summary :tests :failed))]

(println \newline)
(reporting/print-failures results)
(reporting/print-summary results))
(reporting/print-summary summary)

(System/exit 0))))
(System/exit (if failed? 1 0))))))

0 comments on commit 7494d94

Please sign in to comment.