Skip to content
This repository has been archived by the owner on Feb 7, 2024. It is now read-only.

Commit

Permalink
Allow requesting repeated runs of tests
Browse files Browse the repository at this point in the history
  • Loading branch information
muep committed Oct 13, 2022
1 parent ce4e011 commit 1d87125
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions etp-backend/src/main/clj/user.clj
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,15 @@
(let [cpu-count (.availableProcessors (Runtime/getRuntime))
thread-count (if-let [thread-limit (System/getenv "ETP_THREAD_LIMIT")]
(min (Integer/parseInt thread-limit) cpu-count)
cpu-count)]
cpu-count)
repeat-count (if-let [cnt (System/getenv "ETP_TEST_REPEATS")]
(Integer/parseInt cnt)
1)]
(require 'eftest.runner)
(->> ((resolve 'eftest.runner/find-tests) "src/test")
(filter (matching-test test-searches))
((resolve 'eftest.runner/run-tests)))))
(as-> ((resolve 'eftest.runner/find-tests) "src/test") $
(filter (matching-test test-searches) $)
(reduce concat [] (repeat repeat-count $))
((resolve 'eftest.runner/run-tests) $ {:thread-count thread-count}))))

(defn run-tests-and-exit! []
(let [{:keys [fail error]} (run-tests (map re-pattern *command-line-args*))]
Expand Down

0 comments on commit 1d87125

Please sign in to comment.